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

Skip to content

Commit 3ce6cd4

Browse files
committed
Merge pull request libgit2#3494 from leoyanggit/fix_unit_test_build
Fix build for unit test
2 parents d07c9f4 + 505e453 commit 3ce6cd4

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)