Skip to content

Commit e1e538d

Browse files
authored
Merge pull request #1370 from joto/refactor-tests
Refactor tests
2 parents 353e3bf + dd36e43 commit e1e538d

File tree

6 files changed

+107
-166
lines changed

6 files changed

+107
-166
lines changed

tests/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ add_definitions(-DOSM2PGSQLDATA_DIR=\"${osm2pgsql_SOURCE_DIR}/\")
3838

3939
add_library(catch_main_lib STATIC catch-main.cpp)
4040

41-
set_test(test-check-input)
41+
set_test(test-check-input LABELS NoDB)
4242
set_test(test-db-copy-thread)
4343
set_test(test-db-copy-mgr)
4444
set_test(test-domain-matcher LABELS NoDB)

tests/test-check-input.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#include "input.hpp"
44

5-
TEST_CASE("it's good if input data is ordered")
5+
TEST_CASE("it's good if input data is ordered", "[NoDB]")
66
{
77
type_id_version const tiv1{osmium::item_type::node, 1, 1};
88
type_id_version const tiv2{osmium::item_type::node, 1, 2};
@@ -20,7 +20,7 @@ TEST_CASE("it's good if input data is ordered")
2020
REQUIRE_NOTHROW(check_input(tiv6, tiv7));
2121
}
2222

23-
TEST_CASE("negative OSM object ids are not allowed")
23+
TEST_CASE("negative OSM object ids are not allowed", "[NoDB]")
2424
{
2525
type_id_version const tivn{osmium::item_type::node, -17, 1};
2626
type_id_version const tivw{osmium::item_type::way, -1, 1};
@@ -36,7 +36,7 @@ TEST_CASE("negative OSM object ids are not allowed")
3636
"Negative OSM object ids are not allowed: relation id -999.");
3737
}
3838

39-
TEST_CASE("objects of the same type must be ordered")
39+
TEST_CASE("objects of the same type must be ordered", "[NoDB]")
4040
{
4141
type_id_version const tiv1{osmium::item_type::node, 42, 1};
4242
type_id_version const tiv2{osmium::item_type::node, 3, 1};
@@ -45,7 +45,7 @@ TEST_CASE("objects of the same type must be ordered")
4545
"Input data is not ordered: node id 3 after 42.");
4646
}
4747

48-
TEST_CASE("a node after a way or relation is not allowed")
48+
TEST_CASE("a node after a way or relation is not allowed", "[NoDB]")
4949
{
5050
type_id_version const tiv1w{osmium::item_type::way, 42, 1};
5151
type_id_version const tiv1r{osmium::item_type::relation, 42, 1};
@@ -57,7 +57,7 @@ TEST_CASE("a node after a way or relation is not allowed")
5757
"Input data is not ordered: node after relation.");
5858
}
5959

60-
TEST_CASE("a way after a relation is not allowed")
60+
TEST_CASE("a way after a relation is not allowed", "[NoDB]")
6161
{
6262
type_id_version const tiv1{osmium::item_type::relation, 42, 1};
6363
type_id_version const tiv2{osmium::item_type::way, 100, 1};
@@ -66,7 +66,7 @@ TEST_CASE("a way after a relation is not allowed")
6666
"Input data is not ordered: way after relation.");
6767
}
6868

69-
TEST_CASE("versions must be ordered")
69+
TEST_CASE("versions must be ordered", "[NoDB]")
7070
{
7171
type_id_version const tiv1{osmium::item_type::way, 42, 2};
7272
type_id_version const tiv2{osmium::item_type::way, 42, 1};

tests/test-domain-matcher.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ static osmium::Tag &fill_buffer(osmium::memory::Buffer &buffer, char const *key,
2020
return *buffer.get<osmium::TagList>(0).begin();
2121
}
2222

23-
TEST_CASE("DomainMatcher: name")
23+
TEST_CASE("DomainMatcher: name", "[NoDB]")
2424
{
2525
osmium::memory::Buffer buffer{1024};
2626
DomainMatcher matcher{"bridge"};
@@ -32,7 +32,7 @@ TEST_CASE("DomainMatcher: name")
3232
REQUIRE(std::strcmp(result, "name") == 0);
3333
}
3434

35-
TEST_CASE("DomainMatcher: name with language")
35+
TEST_CASE("DomainMatcher: name with language", "[NoDB]")
3636
{
3737
osmium::memory::Buffer buffer{1024};
3838
DomainMatcher matcher{"bridge"};
@@ -45,7 +45,7 @@ TEST_CASE("DomainMatcher: name with language")
4545
REQUIRE(std::strcmp(result, "name:en") == 0);
4646
}
4747

48-
TEST_CASE("DomainMatcher: no :name")
48+
TEST_CASE("DomainMatcher: no :name", "[NoDB]")
4949
{
5050
osmium::memory::Buffer buffer{1024};
5151
DomainMatcher matcher{"bridge"};
@@ -56,7 +56,7 @@ TEST_CASE("DomainMatcher: no :name")
5656
REQUIRE_FALSE(result);
5757
}
5858

59-
TEST_CASE("DomainMatcher: empty matcher")
59+
TEST_CASE("DomainMatcher: empty matcher", "[NoDB]")
6060
{
6161
osmium::memory::Buffer buffer{1024};
6262
DomainMatcher matcher{""};
@@ -68,7 +68,7 @@ TEST_CASE("DomainMatcher: empty matcher")
6868
REQUIRE_FALSE(result);
6969
}
7070

71-
TEST_CASE("DomainMatcher: names")
71+
TEST_CASE("DomainMatcher: names", "[NoDB]")
7272
{
7373
osmium::memory::Buffer buffer{1024};
7474
DomainMatcher matcher{"bridge"};
@@ -80,7 +80,7 @@ TEST_CASE("DomainMatcher: names")
8080
REQUIRE_FALSE(result);
8181
}
8282

83-
TEST_CASE("DomainMatcher: not matching")
83+
TEST_CASE("DomainMatcher: not matching", "[NoDB]")
8484
{
8585
osmium::memory::Buffer buffer{1024};
8686
DomainMatcher matcher{"bridge"};
@@ -91,7 +91,7 @@ TEST_CASE("DomainMatcher: not matching")
9191
REQUIRE_FALSE(result);
9292
}
9393

94-
TEST_CASE("DomainMatcher: empty tag")
94+
TEST_CASE("DomainMatcher: empty tag", "[NoDB]")
9595
{
9696
osmium::memory::Buffer buffer{1024};
9797
DomainMatcher matcher{"bridge"};

0 commit comments

Comments
 (0)