-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify linking; fix log setting; improve unit test
- Loading branch information
Showing
7 changed files
with
54 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#define CATCH_CONFIG_MAIN | ||
#include "../sdk/net/iggy.h" | ||
#include "unit_testutils.h" | ||
|
||
TEST_CASE("check supported Iggy protocols", UT_TAG) { | ||
iggy::net::IggyProtocolProvider provider; | ||
|
||
SECTION("enumerate supported protocols") { | ||
REQUIRE(provider.getSupportedProtocols().size() == 5); | ||
} | ||
|
||
SECTION("check supported protocol definitions") { | ||
auto [protocolName, tlsSupported] = | ||
GENERATE(table<std::string, bool>({{"quic", true}, {"tcp", false}, {"tcp+tls", true}, {"http", false}, {"http+tls", true}})); | ||
|
||
REQUIRE(provider.isSupported(protocolName)); | ||
REQUIRE(provider.getProtocolDefinition(protocolName).getName() == protocolName); | ||
REQUIRE(provider.getProtocolDefinition(protocolName).isTlsSupported() == tlsSupported); | ||
} | ||
|
||
SECTION("create addresses") { | ||
auto [address, protocolName, host, port] = | ||
GENERATE(table<std::string, std::string, std::string, int>({{"quic://localhost:1234", "quic", "localhost", 1234}, | ||
{"tcp://localhost:1234", "tcp", "localhost", 1234}, | ||
{"tcp+tls://localhost:1234", "tcp+tls", "localhost", 1234}, | ||
{"http://localhost:1234", "http", "localhost", 1234}, | ||
{"http+tls://localhost:1234", "http+tls", "localhost", 1234}})); | ||
|
||
auto addr = provider.createAddress(address); | ||
REQUIRE(addr.getProtocol() == protocolName); | ||
REQUIRE(addr.getHost() == host); | ||
REQUIRE(addr.getPort() == port); | ||
} | ||
} |