Refactors test case
authorPeizhao Ou <peizhaoo@uci.edu>
Thu, 1 Feb 2018 22:02:02 +0000 (14:02 -0800)
committerPeizhao Ou <peizhaoo@uci.edu>
Thu, 1 Feb 2018 22:02:02 +0000 (14:02 -0800)
test/junction_driver.cpp

index 1609297..3ac134b 100644 (file)
@@ -16,7 +16,7 @@ const size_t kGCFrequency = 3000;
 const size_t kLeapfrogGCFrequency = 1500;
 
 const size_t kCrudeMapSize = 10000;
-const size_t kCrudePassCount = 40000;
+const size_t kCrudePassCount = 400000;
 const char* kCrudeBenchmarkName = "JunctionMapCrude";
 
 const size_t kGrampaMapSize = 20000;
@@ -82,6 +82,7 @@ void run_crude_map(size_t map_size, size_t pass_count, const char* bench_name,
         }
     }
     junction::DefaultQSBR.update(qsbrContext);
+    junction::DefaultQSBR.destroyContext(qsbrContext );
     auto finish_time = std::chrono::system_clock::now();
     auto dur = finish_time - start_time;
     auto milisecs = std::chrono::duration_cast<std::chrono::milliseconds>(dur);
@@ -144,6 +145,8 @@ void run_test(size_t map_size, size_t pass_count, const char* bench_name,
             }
         }
     }
+    junction::DefaultQSBR.update(qsbrContext);
+    junction::DefaultQSBR.destroyContext(qsbrContext );
     auto finish_time = std::chrono::system_clock::now();
     auto dur = finish_time - start_time;
     auto milisecs = std::chrono::duration_cast<std::chrono::milliseconds>(dur);
@@ -161,13 +164,13 @@ void run_test(size_t map_size, size_t pass_count, const char* bench_name,
 }
 
 int main() {
+    run_crude_map<CrudeMap>(kCrudeMapSize, kCrudePassCount, kCrudeBenchmarkName,
+        kGCFrequency);
     run_test<LeapfrogMap>(kLeapfrogMapSize, kLeapfrogPassCount,
         kLeapfrogBenchmarkName, kLeapfrogGCFrequency );
     run_test<LinearMap>(kLinearMapSize, kLinearPassCount, kLinearBenchmarkName,
         kGCFrequency);
     run_test<GrampaMap>(kGrampaMapSize, kGrampaPassCount, kGrampaBenchmarkName,
         kGCFrequency);
-    run_crude_map<CrudeMap>(kCrudeMapSize, kCrudePassCount, kCrudeBenchmarkName,
-        kGCFrequency);
     return 0;
 }