Skip to content

Commit 3db46e9

Browse files
committed
Use uppercase for constants
1 parent 88e973f commit 3db46e9

2 files changed

Lines changed: 21 additions & 21 deletions

File tree

tests/test-ordered-index.cpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,21 @@
1313

1414
TEST_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

3939
TEST_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

6565
TEST_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

107107
TEST_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

tests/test-output-flex-nodes.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ enum class node_relationship : std::uint8_t
6363
template <node_relationship R>
6464
struct node_rel
6565
{
66-
static constexpr node_relationship rs = R;
66+
static constexpr node_relationship RS = R;
6767
};
6868

6969
using node_rel_none = node_rel<node_relationship::none>;
@@ -87,9 +87,9 @@ TEMPLATE_TEST_CASE("change nodes", "", node_rel_none, node_rel_in_way,
8787

8888
options.append = true;
8989

90-
if (TestType{}.rs == node_relationship::in_way) {
90+
if (TestType{}.RS == node_relationship::in_way) {
9191
REQUIRE_NOTHROW(db.run_import(options, "w20 v1 dV Nn14,n15,n16\n"));
92-
} else if (TestType{}.rs == node_relationship::in_relation) {
92+
} else if (TestType{}.RS == node_relationship::in_relation) {
9393
REQUIRE_NOTHROW(db.run_import(options, "r30 v1 dV Mn14@,n15@,n16@\n"));
9494
}
9595

@@ -174,9 +174,9 @@ TEMPLATE_TEST_CASE("delete nodes", "", node_rel_none, node_rel_in_way,
174174

175175
options.append = true;
176176

177-
if (TestType{}.rs == node_relationship::in_way) {
177+
if (TestType{}.RS == node_relationship::in_way) {
178178
REQUIRE_NOTHROW(db.run_import(options, "w20 v1 dV Nn14,n15,n16\n"));
179-
} else if (TestType{}.rs == node_relationship::in_relation) {
179+
} else if (TestType{}.RS == node_relationship::in_relation) {
180180
REQUIRE_NOTHROW(db.run_import(options, "r30 v1 dV Mn14@,n15@,n16@\n"));
181181
}
182182

0 commit comments

Comments
 (0)