Skip to content

Commit 11e65b1

Browse files
Add test for add-node-envelope command line argument.
1 parent 70005b1 commit 11e65b1

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/config/Config.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ void assertDefaultConfig(const osm2ttl::config::Config& config) {
4242

4343
ASSERT_FALSE(config.addAreaEnvelope);
4444
ASSERT_FALSE(config.addAreaEnvelopeRatio);
45+
ASSERT_FALSE(config.addNodeEnvelope);
4546
ASSERT_TRUE(config.addSortMetadata);
4647
ASSERT_FALSE(config.addWayEnvelope);
4748
ASSERT_FALSE(config.addWayNodeOrder);
@@ -546,6 +547,22 @@ TEST(CONFIG_Config, fromArgsAddAreaEnvelopeRatioLong) {
546547
ASSERT_TRUE(config.addAreaEnvelopeRatio);
547548
}
548549

550+
// ____________________________________________________________________________
551+
TEST(CONFIG_Config, fromArgsAddNodeEnvelopeLong) {
552+
osm2ttl::config::Config config;
553+
assertDefaultConfig(config);
554+
555+
osm2ttl::util::CacheFile cf("/tmp/dummyInput");
556+
auto arg =
557+
"--" + osm2ttl::config::constants::ADD_NODE_ENVELOPE_OPTION_LONG;
558+
const int argc = 3;
559+
char* argv[argc] = {const_cast<char*>(""), const_cast<char*>(arg.c_str()),
560+
const_cast<char*>("/tmp/dummyInput")};
561+
config.fromArgs(argc, argv);
562+
ASSERT_EQ("", config.output.string());
563+
ASSERT_TRUE(config.addNodeEnvelope);
564+
}
565+
549566
// ____________________________________________________________________________
550567
TEST(CONFIG_Config, fromArgsAddWayEnvelopeLong) {
551568
osm2ttl::config::Config config;

0 commit comments

Comments
 (0)