summaryrefslogtreecommitdiff
path: root/libartbase/base/file_utils_test.cc
diff options
context:
space:
mode:
author Victor Chang <vichang@google.com> 2019-07-05 16:32:41 +0100
committer vichang <vichang@google.com> 2019-08-08 11:06:51 +0000
commit6461124331de7707f3b109cec38337d851be997e (patch)
tree551fe08dc46d71f903244080f90df751d648adb5 /libartbase/base/file_utils_test.cc
parent3cb59a4e22bff5a06f5bcd1deb86e2580dd36de3 (diff)
Remove icu .dat file from Runtime module
Bug: 137009149 Bug: 130295968 Test: device boots Test: m out/target/common/obj/JAVA_LIBRARIES/ahat-test-dump_intermediates/test-dump.hprof Test: art/build/apex/runtests.sh fails due to bug 138103882 Test: art/tools/buildbot-build.sh Test: m test-art-host-gtest Change-Id: I0501fd6dd02dac3cf9780f5f1c0103e4b0475e1f
Diffstat (limited to 'libartbase/base/file_utils_test.cc')
-rw-r--r--libartbase/base/file_utils_test.cc31
1 files changed, 18 insertions, 13 deletions
diff --git a/libartbase/base/file_utils_test.cc b/libartbase/base/file_utils_test.cc
index a217770bdd..b26395b9c2 100644
--- a/libartbase/base/file_utils_test.cc
+++ b/libartbase/base/file_utils_test.cc
@@ -102,20 +102,25 @@ TEST_F(FileUtilsTest, GetAndroidRootSafe) {
TEST_F(FileUtilsTest, GetAndroidRuntimeRootSafe) {
std::string error_msg;
+ std::string android_runtime_root;
+ std::string android_runtime_root_env;
- // We don't expect null returns for most cases, so don't check and let std::string crash.
-
- // CommonArtTest sets ANDROID_RUNTIME_ROOT, so expect this to be the same.
- std::string android_runtime_root = GetAndroidRuntimeRootSafe(&error_msg);
- std::string android_runtime_root_env = getenv("ANDROID_RUNTIME_ROOT");
- EXPECT_EQ(android_runtime_root, android_runtime_root_env) << error_msg;
-
- // Set ANDROID_RUNTIME_ROOT to something else (but the directory must exist). So use dirname.
- UniqueCPtr<char> root_dup(strdup(android_runtime_root_env.c_str()));
- char* dir = dirname(root_dup.get());
- ASSERT_EQ(0, setenv("ANDROID_RUNTIME_ROOT", dir, /* overwrite */ 1));
- std::string android_runtime_root2 = GetAndroidRuntimeRootSafe(&error_msg);
- EXPECT_STREQ(dir, android_runtime_root2.c_str()) << error_msg;
+ // TODO(b/130295968): Re-enable this part when the directory exists on host
+ if (kIsTargetBuild) {
+ // We don't expect null returns for most cases, so don't check and let std::string crash.
+
+ // CommonArtTest sets ANDROID_RUNTIME_ROOT, so expect this to be the same.
+ android_runtime_root = GetAndroidRuntimeRootSafe(&error_msg);
+ android_runtime_root_env = getenv("ANDROID_RUNTIME_ROOT");
+ EXPECT_EQ(android_runtime_root, android_runtime_root_env) << error_msg;
+
+ // Set ANDROID_RUNTIME_ROOT to something else (but the directory must exist). So use dirname.
+ UniqueCPtr<char> root_dup(strdup(android_runtime_root_env.c_str()));
+ char* dir = dirname(root_dup.get());
+ ASSERT_EQ(0, setenv("ANDROID_RUNTIME_ROOT", dir, /* overwrite */ 1));
+ std::string android_runtime_root2 = GetAndroidRuntimeRootSafe(&error_msg);
+ EXPECT_STREQ(dir, android_runtime_root2.c_str()) << error_msg;
+ }
// Set a bogus value for ANDROID_RUNTIME_ROOT. This should be an error.
ASSERT_EQ(0, setenv("ANDROID_RUNTIME_ROOT", "/this/is/obviously/bogus", /* overwrite */ 1));