Disable network tests by default, because they can fail depending on the network setup

This commit is contained in:
Sebastian Messmer 2017-10-08 06:54:31 +01:00
parent 5b4a814640
commit 600854572c
1 changed files with 8 additions and 0 deletions

View File

@ -9,6 +9,12 @@ using testing::MatchesRegex;
using namespace cpputils;
// Disable these by default because they depend on network
// and - even if network is available - can fail depending
// on the concrete network setup (e.g. if invalid domains are
// answered with an ISP page instead of HTTP error)
#ifdef CRYFS_ENABLE_NETWORK_TESTS
TEST(CurlHttpClientTest, InvalidProtocol) {
EXPECT_EQ(none, CurlHttpClient().get("invalid://example.com"));
}
@ -30,3 +36,5 @@ TEST(CurlHttpClientTest, ValidHttps) {
string content = CurlHttpClient().get("https://example.com").value();
EXPECT_THAT(content, MatchesRegex(".*Example Domain.*"));
}
#endif