From 4bae7153506c66b76a27c7daf8ba2755c46be9a1 Mon Sep 17 00:00:00 2001 From: Leonardo de Moura Date: Wed, 25 Sep 2013 22:39:49 -0700 Subject: [PATCH] fix(memory): disable problematic test when tcmalloc is used Signed-off-by: Leonardo de Moura --- src/tests/util/memory.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/tests/util/memory.cpp b/src/tests/util/memory.cpp index 7c57a8c2e..9a068825b 100644 --- a/src/tests/util/memory.cpp +++ b/src/tests/util/memory.cpp @@ -21,12 +21,15 @@ static void tst1() { lean_assert(lean::get_allocated_memory() >= old_mem + N * 2 * sizeof(N)); std::cout << "Total: " << static_cast(lean::get_allocated_memory()) << "\n"; std::cout << "Thread: " << static_cast(lean::get_thread_allocated_memory()) << "\n"; - lean_assert(lean::get_allocated_memory() == static_cast(lean::get_thread_allocated_memory())); +#if !defined(HAS_TCMALLOC) + // When TCMALLOC is used, there is a problem during initialization, and the value of get_thread_allocated_memory is off. + lean_assert_eq(lean::get_allocated_memory(), static_cast(lean::get_thread_allocated_memory())); +#endif for (int i = 0; i < N; i++) { lean_assert(a[i] == i); } lean::free(a); - lean_assert(old_mem == lean::get_allocated_memory()); + lean_assert_eq(old_mem, lean::get_allocated_memory()); } int main() {