summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Salyzyn2017-05-02 10:56:15 -0500
committerMark Salyzyn2017-05-04 13:41:17 -0500
commit0f6a270d24ba373fdb74b2059e0366ba4fbbd8fe (patch)
tree1d566ba399526fb43366be62afbaff1b426a86ac /libcutils/fs_config.cpp
parent3d7ee068e0a0ce707965835f58abce65189abda4 (diff)
downloadplatform-system-core-0f6a270d24ba373fdb74b2059e0366ba4fbbd8fe.tar.gz
platform-system-core-0f6a270d24ba373fdb74b2059e0366ba4fbbd8fe.tar.xz
platform-system-core-0f6a270d24ba373fdb74b2059e0366ba4fbbd8fe.zip
libcutils: fs_config internal table alias test
Private interface to permit testing only added to fs_config to expose android_files and android_dirs. Make sure that both paths to a partition are specified in fs_config internal tables. Test: gTest libcutils-unit-test --gtest_filter=fs_config.* Bug: 37703469 Change-Id: Ida5fccdb786dc6d67325005d4fdd1fa1ffaef396
Diffstat (limited to 'libcutils/fs_config.cpp')
-rw-r--r--libcutils/fs_config.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/libcutils/fs_config.cpp b/libcutils/fs_config.cpp
index a2dd67776..2b3443f3f 100644
--- a/libcutils/fs_config.cpp
+++ b/libcutils/fs_config.cpp
@@ -92,6 +92,9 @@ static const struct fs_path_config android_dirs[] = {
92 { 00755, AID_ROOT, AID_ROOT, 0, 0 }, 92 { 00755, AID_ROOT, AID_ROOT, 0, 0 },
93 // clang-format on 93 // clang-format on
94}; 94};
95#ifndef __ANDROID_VNDK__
96auto __for_testing_only__android_dirs = android_dirs;
97#endif
95 98
96// Rules for files. 99// Rules for files.
97// These rules are applied based on "first match", so they 100// These rules are applied based on "first match", so they
@@ -238,6 +241,9 @@ static const struct fs_path_config android_files[] = {
238 { 00644, AID_ROOT, AID_ROOT, 0, 0 }, 241 { 00644, AID_ROOT, AID_ROOT, 0, 0 },
239 // clang-format on 242 // clang-format on
240}; 243};
244#ifndef __ANDROID_VNDK__
245auto __for_testing_only__android_files = android_files;
246#endif
241 247
242static size_t strip(const char* path, size_t len, const char suffix[]) { 248static size_t strip(const char* path, size_t len, const char suffix[]) {
243 if (len < strlen(suffix)) return len; 249 if (len < strlen(suffix)) return len;