Changes for #inclusivefixit.
Test: treehugger
Change-Id: I7ff0496c5c2792a41781e74634247f55b0548213
diff --git a/android-changes-for-ndk-developers.md b/android-changes-for-ndk-developers.md
index a0f3c3c..b8f2f59 100644
--- a/android-changes-for-ndk-developers.md
+++ b/android-changes-for-ndk-developers.md
@@ -218,7 +218,7 @@
Each ELF file has additional information contained in the section
headers. These headers must be present now, because the dynamic linker
-uses them for sanity checking. Some developers strip them in an
+uses them for validity checking. Some developers strip them in an
attempt to obfuscate the binary and prevent reverse engineering. (This
doesn't really help because it is possible to reconstruct the stripped
information using widely-available tools.)
diff --git a/benchmarks/linker_relocation/regen/gen_bench.py b/benchmarks/linker_relocation/regen/gen_bench.py
index 7482319..09efa75 100755
--- a/benchmarks/linker_relocation/regen/gen_bench.py
+++ b/benchmarks/linker_relocation/regen/gen_bench.py
@@ -137,7 +137,7 @@
return defs
-def sanity_check_rels(root: LoadedLibrary, defs: Definitions) -> None:
+def check_rels(root: LoadedLibrary, defs: Definitions) -> None:
# Find every symbol for every relocation in the load group.
has_missing = False
for lib in bfs_walk(root):
@@ -389,7 +389,7 @@
with open(Path(args.input)) as f:
root = json_to_elf_tree(json.load(f))
defs = build_symbol_index(root)
- sanity_check_rels(root, defs)
+ check_rels(root, defs)
if out.exists(): shutil.rmtree(out)
os.makedirs(str(out))
diff --git a/benchmarks/pthread_benchmark.cpp b/benchmarks/pthread_benchmark.cpp
index 9a68a12..856f150 100644
--- a/benchmarks/pthread_benchmark.cpp
+++ b/benchmarks/pthread_benchmark.cpp
@@ -53,15 +53,14 @@
}
BIONIC_BENCHMARK(BM_pthread_setspecific);
-static void DummyPthreadOnceInitFunction() {
-}
+static void NoOpPthreadOnceInitFunction() {}
static void BM_pthread_once(benchmark::State& state) {
static pthread_once_t once = PTHREAD_ONCE_INIT;
- pthread_once(&once, DummyPthreadOnceInitFunction);
+ pthread_once(&once, NoOpPthreadOnceInitFunction);
while (state.KeepRunning()) {
- pthread_once(&once, DummyPthreadOnceInitFunction);
+ pthread_once(&once, NoOpPthreadOnceInitFunction);
}
}
BIONIC_BENCHMARK(BM_pthread_once);
diff --git a/benchmarks/semaphore_benchmark.cpp b/benchmarks/semaphore_benchmark.cpp
index cf51489..ffccc82 100644
--- a/benchmarks/semaphore_benchmark.cpp
+++ b/benchmarks/semaphore_benchmark.cpp
@@ -28,8 +28,8 @@
sem_init(&semaphore, 1, 1);
while (state.KeepRunning()) {
- int dummy;
- sem_getvalue(&semaphore, &dummy);
+ int unused;
+ sem_getvalue(&semaphore, &unused);
}
}
BIONIC_BENCHMARK(BM_semaphore_sem_getvalue);
@@ -44,112 +44,3 @@
}
}
BIONIC_BENCHMARK(BM_semaphore_sem_wait_sem_post);
-
-// This test reports the overhead of the underlying futex wake syscall on
-// the producer. It does not report the overhead from issuing the wake to the
-// point where the posted consumer thread wakes up. It suffers from
-// clock_gettime syscall overhead. Lock the CPU speed for consistent results
-// as we may not reach >50% cpu utilization.
-//
-// We will run a background thread that catches the sem_post wakeup and
-// loops immediately returning back to sleep in sem_wait for the next one. This
-// thread is run with policy SCHED_OTHER (normal policy), a middle policy.
-//
-// The primary thread will run at SCHED_IDLE (lowest priority policy) when
-// monitoring the background thread to detect when it hits sem_wait sleep. It
-// will do so with no clock running. Once we are ready, we will switch to
-// SCHED_FIFO (highest priority policy) to time the act of running sem_post
-// with the benchmark clock running. This ensures nothing else in the system
-// can preempt our timed activity, including the background thread. We are
-// also protected with the scheduling policy of letting a process hit a
-// resource limit rather than get hit with a context switch.
-//
-// The background thread will start executing either on another CPU, or
-// after we back down from SCHED_FIFO, but certainly not in the context of
-// the timing of the sem_post.
-
-static atomic_int BM_semaphore_sem_post_running;
-
-static void* BM_semaphore_sem_post_start_thread(void* arg) {
- sem_t* semaphore = reinterpret_cast<sem_t*>(arg);
- while ((BM_semaphore_sem_post_running > 0) && !sem_wait(semaphore)) {
- }
- BM_semaphore_sem_post_running = -1;
- return nullptr;
-}
-
-class SemaphoreFixture : public benchmark::Fixture {
- public:
- void SetUp(const benchmark::State&) override {
- sem_init(&semaphore, 0, 0);
-
- pthread_attr_t attr;
- pthread_attr_init(&attr);
-
- memset(¶m, 0, sizeof(param));
- pthread_attr_setschedparam(&attr, ¶m);
- pthread_attr_setschedpolicy(&attr, SCHED_OTHER);
- pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
- pthread_t pthread;
- pthread_create(&pthread, &attr, BM_semaphore_sem_post_start_thread, &semaphore);
- pthread_attr_destroy(&attr);
-
- sched_setscheduler(0, SCHED_IDLE, ¶m);
-
- BM_semaphore_sem_post_running = 1;
- setup = true;
- }
-
- ~SemaphoreFixture() override {
- if (setup) {
- // Only do this if the test was actually run.
- sched_setscheduler(0, SCHED_OTHER, ¶m);
-
- if (BM_semaphore_sem_post_running > 0) {
- BM_semaphore_sem_post_running = 0;
- }
- do {
- sem_post(&semaphore);
- sched_yield();
- } while (BM_semaphore_sem_post_running != -1);
- }
- }
-
- sem_t semaphore;
- sched_param param;
- bool setup = false;
-};
-
-// This is commented out because dynamic benchmark registering doesn't currently support fixtures.
-// Uncomment it and recompile to run this benchmark on every run.
-/* BENCHMARK_F(SemaphoreFixture, semaphore_sem_post)(benchmark::State& state) {
- while (state.KeepRunning()) {
- state.PauseTiming();
-
- int trys = 3, dummy = 0;
- do {
- if (BM_semaphore_sem_post_running < 0) {
- sched_setscheduler(0, SCHED_OTHER, ¶m);
- fprintf(stderr, "BM_semaphore_sem_post: start_thread died unexpectedly\n");
- abort();
- }
- sched_yield();
- sem_getvalue(&semaphore, &dummy);
- if (dummy < 0) { // POSIX.1-2001 possibility 1
- break;
- }
- if (dummy == 0) { // POSIX.1-2001 possibility 2
- --trys;
- }
- } while (trys);
-
- param.sched_priority = 1;
- sched_setscheduler(0, SCHED_FIFO, ¶m);
-
- state.ResumeTiming();
- sem_post(&semaphore);
-
- param.sched_priority = 0;
- sched_setscheduler(0, SCHED_IDLE, ¶m);
- }
-}*/
diff --git a/libc/arch-x86/bionic/__libc_init_sysinfo.cpp b/libc/arch-x86/bionic/__libc_init_sysinfo.cpp
index 5c44b4e..db931d1 100644
--- a/libc/arch-x86/bionic/__libc_init_sysinfo.cpp
+++ b/libc/arch-x86/bionic/__libc_init_sysinfo.cpp
@@ -37,8 +37,8 @@
}
__LIBC_HIDDEN__ void __libc_init_sysinfo() {
- bool dummy;
- __libc_sysinfo = reinterpret_cast<void*>(__bionic_getauxval(AT_SYSINFO, dummy));
+ bool unused;
+ __libc_sysinfo = reinterpret_cast<void*>(__bionic_getauxval(AT_SYSINFO, &unused));
}
// TODO: lose this function and just access __libc_sysinfo directly.
diff --git a/libc/bionic/getauxval.cpp b/libc/bionic/getauxval.cpp
index d6f75f8..a3c6b19 100644
--- a/libc/bionic/getauxval.cpp
+++ b/libc/bionic/getauxval.cpp
@@ -37,20 +37,20 @@
// This function needs to be safe to call before TLS is set up, so it can't
// access errno or the stack protector.
-__LIBC_HIDDEN__ unsigned long __bionic_getauxval(unsigned long type, bool& exists) {
+__LIBC_HIDDEN__ unsigned long __bionic_getauxval(unsigned long type, bool* exists) {
for (ElfW(auxv_t)* v = __libc_shared_globals()->auxv; v->a_type != AT_NULL; ++v) {
if (v->a_type == type) {
- exists = true;
+ *exists = true;
return v->a_un.a_val;
}
}
- exists = false;
+ *exists = false;
return 0;
}
extern "C" unsigned long getauxval(unsigned long type) {
bool exists;
- unsigned long result = __bionic_getauxval(type, exists);
+ unsigned long result = __bionic_getauxval(type, &exists);
if (!exists) errno = ENOENT;
return result;
}
diff --git a/libc/bionic/libc_init_common.cpp b/libc/bionic/libc_init_common.cpp
index 1ede969..f1350d5 100644
--- a/libc/bionic/libc_init_common.cpp
+++ b/libc/bionic/libc_init_common.cpp
@@ -359,10 +359,8 @@
Dtor* fini_array = reinterpret_cast<Dtor*>(array);
const Dtor minus1 = reinterpret_cast<Dtor>(static_cast<uintptr_t>(-1));
- // Sanity check - first entry must be -1.
- if (array == nullptr || fini_array[0] != minus1) {
- return;
- }
+ // Validity check: the first entry must be -1.
+ if (array == nullptr || fini_array[0] != minus1) return;
// Skip over it.
fini_array += 1;
@@ -373,15 +371,9 @@
++count;
}
- // Now call each destructor in reverse order.
+ // Now call each destructor in reverse order, ignoring any -1s.
while (count > 0) {
Dtor dtor = fini_array[--count];
-
- // Sanity check, any -1 in the list is ignored.
- if (dtor == minus1) {
- continue;
- }
-
- dtor();
+ if (dtor != minus1) dtor();
}
}
diff --git a/libc/bionic/pthread_attr.cpp b/libc/bionic/pthread_attr.cpp
index 1551c1f..89aa289 100644
--- a/libc/bionic/pthread_attr.cpp
+++ b/libc/bionic/pthread_attr.cpp
@@ -192,7 +192,8 @@
return errno;
}
- // If the current RLIMIT_STACK is RLIM_INFINITY, only admit to an 8MiB stack for sanity's sake.
+ // If the current RLIMIT_STACK is RLIM_INFINITY, only admit to an 8MiB stack
+ // in case callers such as ART take infinity too literally.
if (stack_limit.rlim_cur == RLIM_INFINITY) {
stack_limit.rlim_cur = 8 * 1024 * 1024;
}
diff --git a/libc/bionic/pthread_create.cpp b/libc/bionic/pthread_create.cpp
index d4a8bef..c528105 100644
--- a/libc/bionic/pthread_create.cpp
+++ b/libc/bionic/pthread_create.cpp
@@ -350,7 +350,7 @@
return 0;
}
-// A dummy start routine for pthread_create failures where we've created a thread but aren't
+// A no-op start routine for pthread_create failures where we've created a thread but aren't
// going to run user code on it. We swap out the user's start routine for this and take advantage
// of the regular thread teardown to free up resources.
static void* __do_nothing(void*) {
diff --git a/libc/bionic/sysinfo.cpp b/libc/bionic/sysinfo.cpp
index 1d1070e..7ab8e9e 100644
--- a/libc/bionic/sysinfo.cpp
+++ b/libc/bionic/sysinfo.cpp
@@ -38,9 +38,10 @@
static bool __matches_cpuN(const char* s) {
// The %c trick is to ensure that we have the anchored match "^cpu[0-9]+$".
+ // We can't use %*c because the return value is how many were *assigned*.
unsigned cpu;
- char dummy;
- return (sscanf(s, "cpu%u%c", &cpu, &dummy) == 1);
+ char unused;
+ return (sscanf(s, "cpu%u%c", &cpu, &unused) == 1);
}
int get_nprocs_conf() {
diff --git a/libc/include/nl_types.h b/libc/include/nl_types.h
index 622880a..1c80e4e 100644
--- a/libc/include/nl_types.h
+++ b/libc/include/nl_types.h
@@ -32,7 +32,7 @@
* @file nl_types.h
* @brief Message catalogs.
*
- * Android offers a dummy implementation of these functions to ease porting of historical software.
+ * Android offers a no-op implementation of these functions to ease porting of historical software.
*/
#include <sys/cdefs.h>
diff --git a/libc/private/bionic_auxv.h b/libc/private/bionic_auxv.h
index 8e33c1c..9d2cfdd 100644
--- a/libc/private/bionic_auxv.h
+++ b/libc/private/bionic_auxv.h
@@ -30,4 +30,4 @@
#include <sys/cdefs.h>
-__LIBC_HIDDEN__ unsigned long __bionic_getauxval(unsigned long type, bool& exists);
+__LIBC_HIDDEN__ unsigned long __bionic_getauxval(unsigned long type, bool* exists);
diff --git a/libc/stdio/local.h b/libc/stdio/local.h
index 1ecf122..12f3bf5 100644
--- a/libc/stdio/local.h
+++ b/libc/stdio/local.h
@@ -259,7 +259,7 @@
size_t parsefloat(FILE*, char*, char*);
size_t wparsefloat(FILE*, wchar_t*, wchar_t*);
-// Sanity check a FILE* for nullptr, so we can emit a message while crashing
+// Check a FILE* isn't nullptr, so we can emit a message while crashing
// instead of doing a blind null-dereference.
#define CHECK_FP(fp) \
if (fp == nullptr) __fortify_fatal("%s: null FILE*", __FUNCTION__)
diff --git a/libc/stdio/stdio.cpp b/libc/stdio/stdio.cpp
index a0b4219..afc2c48 100644
--- a/libc/stdio/stdio.cpp
+++ b/libc/stdio/stdio.cpp
@@ -1026,9 +1026,9 @@
__check_count("vsnprintf", "size", n);
// Stdio internals do not deal correctly with zero length buffer.
- char dummy;
+ char one_byte_buffer[1];
if (n == 0) {
- s = &dummy;
+ s = one_byte_buffer;
n = 1;
}
diff --git a/linker/linker.cpp b/linker/linker.cpp
index a41ca09..7cfe87b 100644
--- a/linker/linker.cpp
+++ b/linker/linker.cpp
@@ -3168,7 +3168,7 @@
DEBUG("si->base = %p, si->strtab = %p, si->symtab = %p",
reinterpret_cast<void*>(base), strtab_, symtab_);
- // Sanity checks.
+ // Validity checks.
if (relocating_linker && needed_count != 0) {
DL_ERR("linker cannot have DT_NEEDED dependencies on other libraries");
return false;
diff --git a/linker/linker_block_allocator_test.cpp b/linker/linker_block_allocator_test.cpp
index 359eefb..6fb2b26 100644
--- a/linker/linker_block_allocator_test.cpp
+++ b/linker/linker_block_allocator_test.cpp
@@ -47,14 +47,14 @@
* this one has size below allocator cap which is 2*sizeof(void*)
*/
struct test_struct_small {
- char dummy_str[5];
+ char str[5];
};
/*
* 1009 byte struct (1009 is prime)
*/
struct test_struct_larger {
- char dummy_str[1009];
+ char str[1009];
};
static size_t kPageSize = sysconf(_SC_PAGE_SIZE);
@@ -131,14 +131,14 @@
allocator.protect_all(PROT_READ);
allocator.protect_all(PROT_READ | PROT_WRITE);
// check access
- page2_ptr->dummy_str[23] = 27;
- page1_ptr->dummy_str[13] = 11;
+ page2_ptr->str[23] = 27;
+ page1_ptr->str[13] = 11;
allocator.protect_all(PROT_READ);
fprintf(stderr, "trying to access protected page");
// this should result in segmentation fault
- page1_ptr->dummy_str[11] = 7;
+ page1_ptr->str[11] = 7;
}
TEST(linker_allocator, test_protect) {
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);
diff --git a/tools/versioner/src/DeclarationDatabase.cpp b/tools/versioner/src/DeclarationDatabase.cpp
index b41c865..ec2e38d 100644
--- a/tools/versioner/src/DeclarationDatabase.cpp
+++ b/tools/versioner/src/DeclarationDatabase.cpp
@@ -190,8 +190,8 @@
auto symbol_it = database.symbols.find(declaration_name);
if (symbol_it == database.symbols.end()) {
Symbol symbol = {.name = declaration_name };
- bool dummy;
- std::tie(symbol_it, dummy) = database.symbols.insert({ declaration_name, symbol });
+ bool unused;
+ std::tie(symbol_it, unused) = database.symbols.insert({declaration_name, symbol});
}
auto expansion_range = src_manager.getExpansionRange(range);
diff --git a/tools/versioner/src/Preprocessor.cpp b/tools/versioner/src/Preprocessor.cpp
index 7a5b502..eb88c46 100644
--- a/tools/versioner/src/Preprocessor.cpp
+++ b/tools/versioner/src/Preprocessor.cpp
@@ -237,7 +237,7 @@
return "("s + Join(expressions, ") || (") + ")";
}
-// Assumes that nothing crazy is happening (e.g. having the semicolon be in a macro)
+// Assumes that nothing weird is happening (e.g. having the semicolon be in a macro).
static FileLocation findNextSemicolon(const std::deque<std::string>& lines, FileLocation start) {
unsigned current_line = start.line;
unsigned current_column = start.column;
@@ -373,8 +373,8 @@
guard_map.erase(current);
guard_map.erase(next);
- bool dummy;
- std::tie(current, dummy) = guard_map.insert(std::make_pair(merged, avail));
+ bool unused;
+ std::tie(current, unused) = guard_map.insert(std::make_pair(merged, avail));
next = current;
++next;
}
diff --git a/tools/versioner/src/versioner.cpp b/tools/versioner/src/versioner.cpp
index 99228dd..c818197 100644
--- a/tools/versioner/src/versioner.cpp
+++ b/tools/versioner/src/versioner.cpp
@@ -276,7 +276,7 @@
return intersection;
}
-// Perform a sanity check on a symbol's declarations, enforcing the following invariants:
+// Perform a validity check on a symbol's declarations, enforcing the following invariants:
// 1. At most one inline definition of the function exists (overloaded inline functions for
// _FORTIFY_SOURCE do not count because they are usually introduced to intercept the original
// functions or usually have enable_if attributes).
@@ -334,7 +334,7 @@
return true;
}
-static bool sanityCheck(const HeaderDatabase* database) {
+static bool validityCheck(const HeaderDatabase* database) {
bool error = false;
std::string cwd = getWorkingDir() + "/";
@@ -676,8 +676,8 @@
if (dump) {
declaration_database->dump(location.header_path + "/");
} else {
- if (!sanityCheck(declaration_database.get())) {
- printf("versioner: sanity check failed\n");
+ if (!validityCheck(declaration_database.get())) {
+ printf("versioner: validity check failed\n");
failed = true;
}
diff --git a/tools/versioner/tests/multiple_decl_mismatch/expected_fail b/tools/versioner/tests/multiple_decl_mismatch/expected_fail
index 1d1f266..30e7233 100644
--- a/tools/versioner/tests/multiple_decl_mismatch/expected_fail
+++ b/tools/versioner/tests/multiple_decl_mismatch/expected_fail
@@ -5,4 +5,4 @@
obsoleted = 12
extern declaration @ headers/foo.h:5:1
obsoleted = 9
-versioner: sanity check failed
+versioner: validity check failed
diff --git a/tools/versioner/tests/multiple_definition/expected_fail b/tools/versioner/tests/multiple_definition/expected_fail
index cb4acc6..5abb833 100644
--- a/tools/versioner/tests/multiple_definition/expected_fail
+++ b/tools/versioner/tests/multiple_definition/expected_fail
@@ -4,4 +4,4 @@
no availability
static definition @ headers/bar.h:5:1
no availability
-versioner: sanity check failed
+versioner: validity check failed
diff --git a/tools/versioner/tests/version_mismatch/expected_fail b/tools/versioner/tests/version_mismatch/expected_fail
index f2143a3..95d284b 100644
--- a/tools/versioner/tests/version_mismatch/expected_fail
+++ b/tools/versioner/tests/version_mismatch/expected_fail
@@ -5,4 +5,4 @@
introduced = 9
extern declaration @ headers/foo.h:8:1
introduced = 10
-versioner: sanity check failed
+versioner: validity check failed