From 12d4bf6c2140a12e6eded1180277a18c6579844f Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Thu, 31 Jan 2019 09:52:05 +0100 Subject: [PATCH] cosmetics --- src/mc/sosp/PageStore_test.cpp | 17 +++++++---------- src/mc/sosp/mc_snapshot_test.cpp | 3 ++- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/mc/sosp/PageStore_test.cpp b/src/mc/sosp/PageStore_test.cpp index ba1e4904e3..791bf55ec4 100644 --- a/src/mc/sosp/PageStore_test.cpp +++ b/src/mc/sosp/PageStore_test.cpp @@ -16,10 +16,6 @@ #include "src/mc/sosp/PageStore.hpp" -#define BOOST_CHECK_MESSAGE(a, b) \ - INFO(b); \ - REQUIRE(a); - using simgrid::mc::PageStore; /***********************************/ @@ -55,7 +51,7 @@ void helper_tests::Init() pagesize = (size_t)getpagesize(); store = std::unique_ptr(new simgrid::mc::PageStore(50)); data = mmap(nullptr, getpagesize(), PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); - BOOST_CHECK_MESSAGE(store->size() == 0, "Bad size"); + REQUIRE(store->size() == 0); } void helper_tests::store_page_once() @@ -64,14 +60,14 @@ void helper_tests::store_page_once() pageno[0] = store->store_page(data); REQUIRE(store->get_ref(pageno[0]) == 1); const void* copy = store->get_page(pageno[0]); - BOOST_CHECK_MESSAGE(::memcmp(data, copy, pagesize) == 0, "Page data should be the same"); + REQUIRE(::memcmp(data, copy, pagesize) == 0); // The page data should be the same REQUIRE(store->size() == 1); } void helper_tests::store_same_page() { pageno[1] = store->store_page(data); - BOOST_CHECK_MESSAGE(pageno[0] == pageno[1], "Page should be the same"); + REQUIRE(pageno[0] == pageno[1]); // Page should be the same REQUIRE(store->get_ref(pageno[0]) == 2); REQUIRE(store->size() == 1); } @@ -80,15 +76,16 @@ void helper_tests::store_new_page() { new_content(data, pagesize); pageno[2] = store->store_page(data); - BOOST_CHECK_MESSAGE(pageno[0] != pageno[2], "New page should be different"); + REQUIRE(pageno[0] != pageno[2]); // The new page should be different REQUIRE(store->size() == 2); } void helper_tests::unref_pages() { store->unref_page(pageno[0]); - BOOST_CHECK_MESSAGE(store->get_ref(pageno[0]) == 1, "Bad refcount"); + REQUIRE(store->get_ref(pageno[0]) == 1); REQUIRE(store->size() == 2); + store->unref_page(pageno[1]); REQUIRE(store->size() == 1); } @@ -97,7 +94,7 @@ void helper_tests::reallocate_page() { new_content(data, pagesize); pageno[3] = store->store_page(data); - BOOST_CHECK_MESSAGE(pageno[0] == pageno[3], "Page was not reused"); + REQUIRE(pageno[0] == pageno[3]); // The old page should be reused REQUIRE(store->get_ref(pageno[3]) == 1); REQUIRE(store->size() == 2); } diff --git a/src/mc/sosp/mc_snapshot_test.cpp b/src/mc/sosp/mc_snapshot_test.cpp index 8d8d6d0731..7cef004bb2 100644 --- a/src/mc/sosp/mc_snapshot_test.cpp +++ b/src/mc/sosp/mc_snapshot_test.cpp @@ -176,7 +176,8 @@ void snap_test_helper::read_pointer() munmap(ret.src, ret.size); } -/*************** End: class BOOST_tests *****************************/ +/*************** End: class snap_test_helper *****************************/ + TEST_CASE("MC::Snapshot: A copy/snapshot of a given memory region", "MC::Snapshot") { auto sparse = GENERATE(false, true); -- 2.20.1