Skip to content

Commit 9e29627

Browse files
committed
Add failing test for non-existent flat node file
See #2315
1 parent 1264345 commit 9e29627

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/test-persistent-cache.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,12 @@ TEST_CASE("Persistent cache", "[NoDB]")
107107
read_location(cache, 9934, -179.999, 89.1);
108108
}
109109
}
110+
111+
TEST_CASE("Opening non-existent persistent cache should fail in append mode", "[NoDB]")
112+
{
113+
std::string const flat_node_file =
114+
"test_middle_flat.nonexistent.flat.nodes.bin";
115+
testing::cleanup::file_t const flatnode_cleaner{flat_node_file};
116+
117+
REQUIRE_THROWS(node_persistent_cache(flat_node_file, false));
118+
}

0 commit comments

Comments
 (0)