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
diff --git a/libcutils/fs_config.cpp b/libcutils/fs_config.cpp
index a2dd677..2b3443f 100644
--- a/libcutils/fs_config.cpp
+++ b/libcutils/fs_config.cpp
@@ -92,6 +92,9 @@
{ 00755, AID_ROOT, AID_ROOT, 0, 0 },
// clang-format on
};
+#ifndef __ANDROID_VNDK__
+auto __for_testing_only__android_dirs = android_dirs;
+#endif
// Rules for files.
// These rules are applied based on "first match", so they
@@ -238,6 +241,9 @@
{ 00644, AID_ROOT, AID_ROOT, 0, 0 },
// clang-format on
};
+#ifndef __ANDROID_VNDK__
+auto __for_testing_only__android_files = android_files;
+#endif
static size_t strip(const char* path, size_t len, const char suffix[]) {
if (len < strlen(suffix)) return len;