#include <gtest/gtest.h>
#include <algorithm>
-#include <cassert>
-#include <chrono>
-#include <iostream>
#include <memory>
#include <random>
namespace junction_test {
-class JunctionMapInsDelFindTest : public ::testing::Test {
+class JunctionMapInsDelFindTest_Parallel : public ::testing::Test {
protected:
typedef junction::ConcurrentMap_Grampa<size_t, size_t> GrampaMap;
typedef junction::ConcurrentMap_Linear<size_t, size_t> LinearMap;
return map->get(key) != ((Key)0);
}
- template <typename Map>
- void run_test(Map* map, size_t pass_count) {
+ template <typename Map> void run_test(Map* map, size_t pass_count) {
auto qsbrContext = junction::DefaultQSBR.createContext();
std::random_device rd;
}
};
-const unsigned JunctionMapInsDelFindTest::s_nInsertPercentage;
-const unsigned JunctionMapInsDelFindTest::s_nDeletePercentage;
-const unsigned int JunctionMapInsDelFindTest::kShuffleSize;
-JunctionMapInsDelFindTest::actions JunctionMapInsDelFindTest::s_arrShuffle
- [JunctionMapInsDelFindTest::kShuffleSize];
+const unsigned JunctionMapInsDelFindTest_Parallel::s_nInsertPercentage;
+const unsigned JunctionMapInsDelFindTest_Parallel::s_nDeletePercentage;
+const unsigned int JunctionMapInsDelFindTest_Parallel::kShuffleSize;
+JunctionMapInsDelFindTest_Parallel::actions JunctionMapInsDelFindTest_Parallel::
+ s_arrShuffle[JunctionMapInsDelFindTest_Parallel::kShuffleSize];
-TEST_F(JunctionMapInsDelFindTest, JunctionMapCrude) {
+TEST_F(JunctionMapInsDelFindTest_Parallel, JunctionMapCrude) {
std::unique_ptr<CrudeMap> map(new CrudeMap(kMapSize * 32));
run_test(map.get(), kCrudePassCount);
}
-TEST_F(JunctionMapInsDelFindTest, JunctionMapLeapfrog) {
+TEST_F(JunctionMapInsDelFindTest_Parallel, JunctionMapLeapfrog) {
std::unique_ptr<LeapfrogMap> map(new LeapfrogMap());
run_test(map.get(), kLeapfrogPassCount);
}
-TEST_F(JunctionMapInsDelFindTest, JunctionMapLinear) {
+TEST_F(JunctionMapInsDelFindTest_Parallel, JunctionMapLinear) {
std::unique_ptr<LinearMap> map(new LinearMap());
run_test(map.get(), kLinearPassCount);
}
-TEST_F(JunctionMapInsDelFindTest, JunctionMapGrampa) {
+TEST_F(JunctionMapInsDelFindTest_Parallel, JunctionMapGrampa) {
std::unique_ptr<GrampaMap> map(new GrampaMap());
run_test(map.get(), kGrampaPassCount);
}
// Init Google test
::testing::InitGoogleTest(&argc, argv);
int result = RUN_ALL_TESTS();
- return 0;
+ return result;
}