summaryrefslogtreecommitdiffstats
path: root/libcutils/tests
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2019-02-08 15:38:43 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2019-02-08 15:38:43 +0000
commit2210f80e48839fc38d18155d4221d64f6f7d78e9 (patch)
treedfdbc8a60ee450a4102c4f7a0eda318c210559f7 /libcutils/tests
parent2dcb4160fa9c8b28a8daa4192a642c4d8f72e318 (diff)
parenta2159c493ba15218dc457192ef754241adcd7ec4 (diff)
downloadsystem_core-2210f80e48839fc38d18155d4221d64f6f7d78e9.tar.gz
system_core-2210f80e48839fc38d18155d4221d64f6f7d78e9.tar.bz2
system_core-2210f80e48839fc38d18155d4221d64f6f7d78e9.zip
Merge "fs_config supports shell wildcard patterns"
Diffstat (limited to 'libcutils/tests')
-rw-r--r--libcutils/tests/Android.bp3
-rw-r--r--libcutils/tests/fs_config.cpp14
2 files changed, 14 insertions, 3 deletions
diff --git a/libcutils/tests/Android.bp b/libcutils/tests/Android.bp
index fb9bbdd92..3892ce012 100644
--- a/libcutils/tests/Android.bp
+++ b/libcutils/tests/Android.bp
@@ -20,6 +20,7 @@ cc_defaults {
android: {
srcs: [
"AshmemTest.cpp",
+ "fs_config.cpp",
"MemsetTest.cpp",
"PropertiesTest.cpp",
"sched_policy_test.cpp",
@@ -28,13 +29,13 @@ cc_defaults {
"android_get_control_socket_test.cpp",
"android_get_control_file_test.cpp",
"multiuser_test.cpp",
- "fs_config.cpp",
],
},
not_windows: {
srcs: [
"test_str_parms.cpp",
+ "fs_config.cpp",
],
},
},
diff --git a/libcutils/tests/fs_config.cpp b/libcutils/tests/fs_config.cpp
index d5dc66a97..c26315fea 100644
--- a/libcutils/tests/fs_config.cpp
+++ b/libcutils/tests/fs_config.cpp
@@ -42,11 +42,15 @@ static const struct fs_config_cmp_test {
const char* path;
bool match;
} fs_config_cmp_tests[] = {
- // clang-format off
+ // clang-format off
{ true, "system/lib", "system/lib/hw", true },
{ true, "vendor/lib", "system/vendor/lib/hw", true },
{ true, "system/vendor/lib", "vendor/lib/hw", true },
{ true, "system/vendor/lib", "system/vendor/lib/hw", true },
+ { true, "foo/*/bar/*", "foo/1/bar/2", true },
+ { true, "foo/*/bar/*", "foo/1/bar", true },
+ { true, "foo/*/bar/*", "foo/1/bar/2/3", true },
+ { true, "foo/*/bar/*", "foo/1/bar/2/3/", true },
{ false, "vendor/bin/wifi", "system/vendor/bin/w", false },
{ false, "vendor/bin/wifi", "system/vendor/bin/wifi", true },
{ false, "vendor/bin/wifi", "system/vendor/bin/wifi2", false },
@@ -58,8 +62,14 @@ static const struct fs_config_cmp_test {
{ false, "vendor/bin/*", "system/vendor/bin/wifi", true },
{ false, "system/bin/*", "system/bin", false },
{ false, "system/vendor/bin/*", "vendor/bin/wifi", true },
+ { false, "foo/*/bar/*", "foo/1/bar/2", true },
+ { false, "foo/*/bar/*", "foo/1/bar", false },
+ { false, "foo/*/bar/*", "foo/1/bar/2/3", true },
+ { false, "foo/*/bar/*.so", "foo/1/bar/2/3", false },
+ { false, "foo/*/bar/*.so", "foo/1/bar/2.so", true },
+ { false, "foo/*/bar/*.so", "foo/1/bar/2/3.so", true },
{ false, NULL, NULL, false },
- // clang-format on
+ // clang-format on
};
static bool check_unique(std::vector<const char*>& paths, const std::string& config_name,