about summary refs log tree commit diff homepage
path: root/unittests
diff options
context:
space:
mode:
authorDaniel Schemmel <daniel@schemmel.net>2023-06-29 00:57:09 +0000
committerCristian Cadar <c.cadar@imperial.ac.uk>2023-07-06 23:35:46 +0200
commitc699cc56365d828388b082ff0f64bc4d6f7496c7 (patch)
tree7822a84c072e9afb46a3f74f3669715db99c2764 /unittests
parentca0d0951c1e43cb5a18e668371f22a12416a98df (diff)
downloadklee-c699cc56365d828388b082ff0f64bc4d6f7496c7.tar.gz
Perform location_info tests in KDAlloc's random test
Diffstat (limited to 'unittests')
-rw-r--r--unittests/KDAlloc/randomtest.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/unittests/KDAlloc/randomtest.cpp b/unittests/KDAlloc/randomtest.cpp
index 1120ee4e..c78746bb 100644
--- a/unittests/KDAlloc/randomtest.cpp
+++ b/unittests/KDAlloc/randomtest.cpp
@@ -78,7 +78,17 @@ public:
       auto choice = std::uniform_int_distribution<std::size_t>(
           0, allocations.size() - 1)(rng);
 #if defined(USE_KDALLOC)
+      assert(allocator.location_info(allocations[choice].first, 1) ==
+             klee::kdalloc::LocationInfo::LI_AllocatedOrQuarantined);
+      assert(allocator.location_info(allocations[choice].first,
+                                     allocations[choice].second) ==
+             klee::kdalloc::LocationInfo::LI_AllocatedOrQuarantined);
       allocator.free(allocations[choice].first, allocations[choice].second);
+      assert(allocator.location_info(allocations[choice].first, 1) ==
+             klee::kdalloc::LocationInfo::LI_Unallocated);
+      assert(allocator.location_info(allocations[choice].first,
+                                     allocations[choice].second) ==
+             klee::kdalloc::LocationInfo::LI_Unallocated);
 #else
       free(allocations[choice].first);
 #endif
@@ -152,7 +162,7 @@ int main() {
   auto start = std::chrono::steady_clock::now();
 
   RandomTest tester;
-  tester.run(10'000'000);
+  tester.run(1'000'000);
 
   auto stop = std::chrono::steady_clock::now();
   std::cout << std::dec