Skip to content

Commit 8fa8e32

Browse files
committed
Simplify test code for node_persistent_cache, no need for options
1 parent 15e4365 commit 8fa8e32

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

tests/test-persistent-cache.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
#include <catch.hpp>
22

33
#include "node-persistent-cache.hpp"
4-
#include "options.hpp"
54

65
#include "common-cleanup.hpp"
7-
#include "common-options.hpp"
86

97
static void write_and_read_location(node_persistent_cache &cache, osmid_t id,
108
double x, double y)
@@ -27,12 +25,12 @@ static void delete_location(node_persistent_cache &cache, osmid_t id)
2725

2826
TEST_CASE("Persistent cache", "[NoDB]")
2927
{
30-
options_t const options = testing::opt_t().flatnodes();
31-
testing::cleanup::file_t flatnode_cleaner{options.flat_node_file};
28+
std::string const flat_node_file = "test_middle_flat.flat.nodes.bin";
29+
testing::cleanup::file_t flatnode_cleaner{flat_node_file};
3230

3331
// create a new cache
3432
{
35-
node_persistent_cache cache{options.flat_node_file, false};
33+
node_persistent_cache cache{flat_node_file, false};
3634

3735
// write in order
3836
write_and_read_location(cache, 10, 10.01, -45.3);
@@ -55,7 +53,7 @@ TEST_CASE("Persistent cache", "[NoDB]")
5553

5654
// reopen the cache
5755
{
58-
node_persistent_cache cache{options.flat_node_file, false};
56+
node_persistent_cache cache{flat_node_file, false};
5957

6058
// read all previously written locations
6159
read_location(cache, 10, 10.01, -45.3);

0 commit comments

Comments
 (0)