Changes for #inclusivefixit.
Test: treehugger
Change-Id: I7ff0496c5c2792a41781e74634247f55b0548213
diff --git a/tests/bionic_allocator_test.cpp b/tests/bionic_allocator_test.cpp
index f710907..fdcf868 100644
--- a/tests/bionic_allocator_test.cpp
+++ b/tests/bionic_allocator_test.cpp
@@ -42,19 +42,19 @@
* this one has size below allocator cap which is 2*sizeof(void*)
*/
struct test_struct_small {
- char dummy_str[5];
+ char str[5];
};
struct test_struct_large {
- char dummy_str[1009];
+ char str[1009];
};
struct test_struct_huge {
- char dummy_str[73939];
+ char str[73939];
};
struct test_struct_512 {
- char dummy_str[503];
+ char str[503];
};
};
diff --git a/tests/dlext_test.cpp b/tests/dlext_test.cpp
index 1139e53..4c4a1c3 100644
--- a/tests/dlext_test.cpp
+++ b/tests/dlext_test.cpp
@@ -2022,7 +2022,7 @@
}
}
- // some sanity checks..
+ // Some validity checks.
ASSERT_TRUE(addr_start > 0);
ASSERT_TRUE(addr_end > 0);
ASSERT_TRUE(maps_to_copy.size() > 0);
diff --git a/tests/ftw_test.cpp b/tests/ftw_test.cpp
index dfc4d72..200ed4b 100644
--- a/tests/ftw_test.cpp
+++ b/tests/ftw_test.cpp
@@ -49,7 +49,7 @@
ASSERT_EQ(0, close(fd));
}
-void sanity_check_ftw(const char* fpath, const struct stat* sb, int tflag) {
+void smoke_test_ftw(const char* fpath, const struct stat* sb, int tflag) {
ASSERT_TRUE(fpath != nullptr);
ASSERT_TRUE(sb != nullptr);
@@ -75,28 +75,28 @@
}
}
-void sanity_check_nftw(const char* fpath, const struct stat* sb, int tflag, FTW* ftwbuf) {
- sanity_check_ftw(fpath, sb, tflag);
+void smoke_test_nftw(const char* fpath, const struct stat* sb, int tflag, FTW* ftwbuf) {
+ smoke_test_ftw(fpath, sb, tflag);
ASSERT_EQ('/', fpath[ftwbuf->base - 1]) << fpath;
}
int check_ftw(const char* fpath, const struct stat* sb, int tflag) {
- sanity_check_ftw(fpath, sb, tflag);
+ smoke_test_ftw(fpath, sb, tflag);
return 0;
}
int check_ftw64(const char* fpath, const struct stat64* sb, int tflag) {
- sanity_check_ftw(fpath, reinterpret_cast<const struct stat*>(sb), tflag);
+ smoke_test_ftw(fpath, reinterpret_cast<const struct stat*>(sb), tflag);
return 0;
}
int check_nftw(const char* fpath, const struct stat* sb, int tflag, FTW* ftwbuf) {
- sanity_check_nftw(fpath, sb, tflag, ftwbuf);
+ smoke_test_nftw(fpath, sb, tflag, ftwbuf);
return 0;
}
int check_nftw64(const char* fpath, const struct stat64* sb, int tflag, FTW* ftwbuf) {
- sanity_check_nftw(fpath, reinterpret_cast<const struct stat*>(sb), tflag, ftwbuf);
+ smoke_test_nftw(fpath, reinterpret_cast<const struct stat*>(sb), tflag, ftwbuf);
return 0;
}
diff --git a/tests/libs/dlopen_b.cpp b/tests/libs/dlopen_b.cpp
index cd81e16..092c96c 100644
--- a/tests/libs/dlopen_b.cpp
+++ b/tests/libs/dlopen_b.cpp
@@ -1,15 +1,14 @@
#include <dlfcn.h>
extern "C" void *dlopen_b() {
- // TODO (dimitry): this is to work around http://b/20049306
- // remove once it is fixed
- static int dummy = 0;
+ // Work around for http://b/20049306, which isn't going to be fixed.
+ static int defeat_sibling_call_optimization = 0;
// This is supposed to succeed because this library has DT_RUNPATH
// for libtest_dt_runpath_x.so which should be taken into account
// by dlopen.
void *handle = dlopen("libtest_dt_runpath_x.so", RTLD_NOW);
if (handle != nullptr) {
- dummy++;
+ defeat_sibling_call_optimization++;
return handle;
}
return nullptr;
diff --git a/tests/libs/elftls_dynamic.cpp b/tests/libs/elftls_dynamic.cpp
index 6da2f6f..2500484 100644
--- a/tests/libs/elftls_dynamic.cpp
+++ b/tests/libs/elftls_dynamic.cpp
@@ -41,8 +41,8 @@
// section, but does not have an entry in the dynsym table and whose
// solib-relative address appears to overlap with the large TLS variable.
extern "C" void* get_local_addr() {
- static char dummy[1024];
- return &dummy[512];
+ static char buf[1024];
+ return &buf[512];
}
// This variable comes from libtest_elftls_shared_var.so, which is part of
diff --git a/tests/link_test.cpp b/tests/link_test.cpp
index 75bb4d6..127a3d9 100644
--- a/tests/link_test.cpp
+++ b/tests/link_test.cpp
@@ -258,7 +258,7 @@
ASSERT_TRUE(entries != nullptr);
ASSERT_GT(count, 0);
- // Sanity checks
+ // Validity checks.
uintptr_t func = reinterpret_cast<uintptr_t>(read_exidx_func);
bool found = false;
for (int i = 0; i < count; ++i) {
diff --git a/tests/stdatomic_test.cpp b/tests/stdatomic_test.cpp
index 11d41b4..7b98df2 100644
--- a/tests/stdatomic_test.cpp
+++ b/tests/stdatomic_test.cpp
@@ -192,7 +192,7 @@
atomic_uint_least32_t z;
};
-// Very simple acquire/release memory ordering sanity check.
+// Very simple acquire/release memory ordering smoke test.
static void* writer(void* arg) {
three_atomics* a = reinterpret_cast<three_atomics*>(arg);
for (uint_least32_t i = 0; i <= BIG; i+=2) {
@@ -239,7 +239,7 @@
}
TEST(stdatomic, ordering) {
- // Run a memory ordering sanity test.
+ // Run a memory ordering smoke test.
void* result;
three_atomics a;
atomic_init(&a.x, 0ul);