1313
1414TEST_CASE (" ordered index basics" , " [NoDB]" )
1515{
16- constexpr std::size_t block_size = 16 ;
17- ordered_index_t index{block_size };
16+ constexpr std::size_t BLOCK_SIZE = 16 ;
17+ ordered_index_t index{BLOCK_SIZE };
1818
1919 REQUIRE (index.size () == 0 );
2020 REQUIRE (index.capacity () == 0 );
2121 REQUIRE (index.used_memory () == 0 );
2222
2323 index.add (17 , 32 );
2424 REQUIRE (index.size () == 1 );
25- REQUIRE (index.capacity () == block_size );
25+ REQUIRE (index.capacity () == BLOCK_SIZE );
2626 REQUIRE (index.used_memory () > 0 );
2727
2828 index.add (19 , 33 );
2929 REQUIRE (index.size () == 2 );
30- REQUIRE (index.capacity () == block_size );
30+ REQUIRE (index.capacity () == BLOCK_SIZE );
3131 REQUIRE (index.used_memory () > 0 );
3232
3333 index.clear ();
@@ -38,8 +38,8 @@ TEST_CASE("ordered index basics", "[NoDB]")
3838
3939TEST_CASE (" ordered index set/get" , " [NoDB]" )
4040{
41- constexpr std::size_t block_size = 16 ;
42- ordered_index_t index{block_size };
41+ constexpr std::size_t BLOCK_SIZE = 16 ;
42+ ordered_index_t index{BLOCK_SIZE };
4343
4444 index.add (19 , 0 );
4545 index.add (22 , 10 );
@@ -64,23 +64,23 @@ TEST_CASE("ordered index set/get", "[NoDB]")
6464
6565TEST_CASE (" ordered index set/get with multiple second-level blocks" , " [NoDB]" )
6666{
67- constexpr std::size_t block_size = 4 ;
68- ordered_index_t index{block_size };
67+ constexpr std::size_t BLOCK_SIZE = 4 ;
68+ ordered_index_t index{BLOCK_SIZE };
6969
7070 index.add (19 , 0 );
7171 index.add (22 , 10 );
7272 index.add (23 , 22 );
7373 index.add (26 , 24 );
7474 REQUIRE (index.size () == 4 );
75- REQUIRE (index.capacity () == block_size );
75+ REQUIRE (index.capacity () == BLOCK_SIZE );
7676
7777 REQUIRE (index.get (31 ) == index.not_found_value ());
7878
7979 index.add (31 , 25 );
8080 index.add (42 , 30 );
8181 index.add (65 , 32 );
8282 REQUIRE (index.size () == 7 );
83- REQUIRE (index.capacity () == block_size * (1 + 2 ));
83+ REQUIRE (index.capacity () == BLOCK_SIZE * (1 + 2 ));
8484
8585 REQUIRE (index.get (22 ) == 10 );
8686 REQUIRE (index.get (23 ) == 22 );
@@ -106,24 +106,24 @@ TEST_CASE("ordered index set/get with multiple second-level blocks", "[NoDB]")
106106
107107TEST_CASE (" ordered index with huge gaps in ids" , " [NoDB]" )
108108{
109- constexpr std::size_t block_size = 4 ;
110- ordered_index_t index{block_size };
109+ constexpr std::size_t BLOCK_SIZE = 4 ;
110+ ordered_index_t index{BLOCK_SIZE };
111111
112112 index.add (1 , 0 );
113113 REQUIRE (index.size () == 1 );
114- REQUIRE (index.capacity () == block_size );
114+ REQUIRE (index.capacity () == BLOCK_SIZE );
115115
116116 index.add ((1ULL << 32U ) + 3U , 1 );
117117 REQUIRE (index.size () == 2 );
118- REQUIRE (index.capacity () == block_size * (1 + 2 ));
118+ REQUIRE (index.capacity () == BLOCK_SIZE * (1 + 2 ));
119119
120120 index.add ((1ULL << 32U ) + 4U , 2 );
121121 REQUIRE (index.size () == 3 );
122- REQUIRE (index.capacity () == block_size * (1 + 2 ));
122+ REQUIRE (index.capacity () == BLOCK_SIZE * (1 + 2 ));
123123
124124 index.add ((2ULL << 32U ) + 9U , 3 );
125125 REQUIRE (index.size () == 4 );
126- REQUIRE (index.capacity () == block_size * (1 + 2 + 4 ));
126+ REQUIRE (index.capacity () == BLOCK_SIZE * (1 + 2 + 4 ));
127127
128128 REQUIRE (index.used_memory () > (index.capacity () * 8 ));
129129
0 commit comments