diff options
author | Frank Busse <bb0xfb@gmail.com> | 2023-03-30 22:25:09 +0100 |
---|---|---|
committer | MartinNowack <2443641+MartinNowack@users.noreply.github.com> | 2024-01-12 12:00:35 +0000 |
commit | 5ca8f5a020cca251a0d5d08bc855bf945735c1af (patch) | |
tree | 2df0f2a9e84de990acf2b8201456eabf77eb72a4 | |
parent | 19b6ae578b0658115d15848604a28434845bb3e3 (diff) | |
download | klee-5ca8f5a020cca251a0d5d08bc855bf945735c1af.tar.gz |
SearcherTest: remove redundant root init, fix branch type
-rw-r--r-- | unittests/Searcher/CMakeLists.txt | 4 | ||||
-rw-r--r-- | unittests/Searcher/SearcherTest.cpp | 11 |
2 files changed, 6 insertions, 9 deletions
diff --git a/unittests/Searcher/CMakeLists.txt b/unittests/Searcher/CMakeLists.txt index bad3504a..7132f1d6 100644 --- a/unittests/Searcher/CMakeLists.txt +++ b/unittests/Searcher/CMakeLists.txt @@ -1,8 +1,8 @@ add_klee_unit_test(SearcherTest SearcherTest.cpp) -target_link_libraries(SearcherTest PRIVATE kleeCore ${SQLITE3_LIBRARIES}) +target_link_libraries(SearcherTest PRIVATE kleeCore ${SQLite3_LIBRARIES}) target_include_directories(SearcherTest BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/lib") target_compile_options(SearcherTest PRIVATE ${KLEE_COMPONENT_CXX_FLAGS}) target_compile_definitions(SearcherTest PRIVATE ${KLEE_COMPONENT_CXX_DEFINES}) -target_include_directories(SearcherTest PRIVATE ${KLEE_INCLUDE_DIRS} ${SQLITE3_INCLUDE_DIRS}) +target_include_directories(SearcherTest PRIVATE ${KLEE_INCLUDE_DIRS} ${SQLite3_INCLUDE_DIRS}) diff --git a/unittests/Searcher/SearcherTest.cpp b/unittests/Searcher/SearcherTest.cpp index fc0d30ac..f9089615 100644 --- a/unittests/Searcher/SearcherTest.cpp +++ b/unittests/Searcher/SearcherTest.cpp @@ -25,7 +25,6 @@ TEST(SearcherTest, RandomPath) { // First state ExecutionState es; InMemoryPTree processTree(es); - es.ptreeNode = processTree.root.getPointer(); RNG rng; RandomPathSearcher rp(&processTree, rng); @@ -37,7 +36,7 @@ TEST(SearcherTest, RandomPath) { // Two states ExecutionState es1(es); - processTree.attach(es.ptreeNode, &es1, &es, BranchType::NONE); + processTree.attach(es.ptreeNode, &es1, &es, BranchType::Conditional); rp.update(&es, {&es1}, {}); // Random path seed dependant @@ -65,10 +64,9 @@ TEST(SearcherTest, TwoRandomPath) { // Root state ExecutionState root; InMemoryPTree processTree(root); - root.ptreeNode = processTree.root.getPointer(); ExecutionState es(root); - processTree.attach(root.ptreeNode, &es, &root, BranchType::NONE); + processTree.attach(root.ptreeNode, &es, &root, BranchType::Conditional); RNG rng, rng1; RandomPathSearcher rp(&processTree, rng); @@ -83,7 +81,7 @@ TEST(SearcherTest, TwoRandomPath) { // Two states ExecutionState es1(es); - processTree.attach(es.ptreeNode, &es1, &es, BranchType::NONE); + processTree.attach(es.ptreeNode, &es1, &es, BranchType::Conditional); rp.update(&es, {}, {}); rp1.update(nullptr, {&es1}, {}); @@ -123,7 +121,6 @@ TEST(SearcherTest, TwoRandomPathDot) { // Root state ExecutionState root; InMemoryPTree processTree(root); - root.ptreeNode = processTree.root.getPointer(); rootPNode = root.ptreeNode; ExecutionState es(root); @@ -201,11 +198,11 @@ TEST(SearcherTest, TwoRandomPathDot) { processTree.remove(es1.ptreeNode); processTree.remove(root.ptreeNode); } + TEST(SearcherDeathTest, TooManyRandomPaths) { // First state ExecutionState es; InMemoryPTree processTree(es); - es.ptreeNode = processTree.root.getPointer(); processTree.remove(es.ptreeNode); // Need to remove to avoid leaks RNG rng; |