Skip to content

Commit

Permalink
add test_server_telegramoptions_get_wrong_keys TEST_CASE
Browse files Browse the repository at this point in the history
  • Loading branch information
w0lek committed Apr 2, 2024
1 parent faf9a07 commit f9ffb52
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions vpr/test/test_server_telegramoptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,15 @@ TEST_CASE("test_server_telegramoptions", "[vpr]") {
REQUIRE(options.getBool("is_flat_routing", true) == false);
}

TEST_CASE("test_server_telegramoptions_get_wrong_keys", "[vpr]") {
server::TelegramOptions options{"int:path_num:11;string:path_type:debug;int:details_level:3;bool:is_flat_routing:0", {"_path_num", "_path_type", "_details_level", "_is_flat_routing"}};

REQUIRE(!options.errorsStr().empty());

REQUIRE(options.getString("_path_type") == "");
REQUIRE(options.getInt("_path_num", -1) == -1);
REQUIRE(options.getInt("_details_level", -1) == -1);
REQUIRE(options.getBool("_is_flat_routing", true) == true);
}

} // namespace

0 comments on commit f9ffb52

Please sign in to comment.