Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 505e453

Browse files
author
Leo Yang
committed
Fix build for unit test
If none of GIT_OPENSSL, GIT_WINHTTP or GIT_SECURE_TRANSPORT is defined we should also be able to build the unit test.
1 parent e0be1d6 commit 505e453

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

tests/online/badssl.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,34 @@
55
static git_repository *g_repo;
66

77
#if defined(GIT_OPENSSL) || defined(GIT_WINHTTP) || defined(GIT_SECURE_TRANSPORT)
8+
static bool g_has_ssl = true;
9+
#else
10+
static bool g_has_ssl = false;
11+
#endif
812

913
void test_online_badssl__expired(void)
1014
{
15+
if (!g_has_ssl)
16+
cl_skip();
17+
1118
cl_git_fail_with(GIT_ECERTIFICATE,
1219
git_clone(&g_repo, "https://expired.badssl.com/fake.git", "./fake", NULL));
1320
}
1421

1522
void test_online_badssl__wrong_host(void)
1623
{
24+
if (!g_has_ssl)
25+
cl_skip();
26+
1727
cl_git_fail_with(GIT_ECERTIFICATE,
1828
git_clone(&g_repo, "https://wrong.host.badssl.com/fake.git", "./fake", NULL));
1929
}
2030

2131
void test_online_badssl__self_signed(void)
2232
{
33+
if (!g_has_ssl)
34+
cl_skip();
35+
2336
cl_git_fail_with(GIT_ECERTIFICATE,
2437
git_clone(&g_repo, "https://self-signed.badssl.com/fake.git", "./fake", NULL));
2538
}
26-
27-
#endif

0 commit comments

Comments
 (0)