1
+ #include " bliss_index_tests.h"
2
+
3
+ class PGMTest : public BlissIndexTest {};
4
+
5
+
6
+ TEST_F (PGMTest, TestPGM_Sanity) {
7
+ index.reset (new bliss::PGMIndex<key_type, key_type>());
8
+ std::vector<key_type> data;
9
+ int key = 100'000 ;
10
+ int value = 123'456 ;
11
+ index->put (key, value);
12
+ EXPECT_TRUE (index->get (key));
13
+ }
14
+
15
+
16
+ TEST_F (PGMTest, TestPGM_Sorted) {
17
+ index.reset (new bliss::PGMIndex<key_type, key_type>());
18
+ std::vector<key_type> data;
19
+ GenerateData (data, num_keys);
20
+
21
+ auto insert_start = data.begin ();
22
+ auto insert_end = data.end ();
23
+ executor::execute_inserts (*index, insert_start, insert_end);
24
+
25
+ for (auto key : data) {
26
+ EXPECT_TRUE (index->get (key));
27
+ }
28
+ }
29
+
30
+
31
+ TEST_F (PGMTest, TestPGM_Random) {
32
+ index.reset (new bliss::PGMIndex<key_type, key_type>());
33
+ std::vector<key_type> data;
34
+ GenerateData (data, num_keys, false );
35
+
36
+ auto insert_start = data.begin ();
37
+ auto insert_end = data.end ();
38
+ executor::execute_inserts (*index, insert_start, insert_end);
39
+
40
+ for (auto key : data) {
41
+ EXPECT_TRUE (index->get (key));
42
+ }
43
+ }
0 commit comments