Commit c8d5b43b by Edward Thomson

tests: skip sha256 tests when not compiled in

Actually `cl_skip` the sha256 tests when we're not compiled for sha256,
instead of passing them.
parent d111cc9b
...@@ -52,7 +52,9 @@ void test_core_oid__streq_sha1(void) ...@@ -52,7 +52,9 @@ void test_core_oid__streq_sha1(void)
void test_core_oid__streq_sha256(void) void test_core_oid__streq_sha256(void)
{ {
#ifdef GIT_EXPERIMENTAL_SHA256 #ifndef GIT_EXPERIMENTAL_SHA256
cl_skip();
#else
cl_assert_equal_i(0, git_oid_streq(&id_sha256, str_oid_sha256)); cl_assert_equal_i(0, git_oid_streq(&id_sha256, str_oid_sha256));
cl_assert_equal_i(-1, git_oid_streq(&id_sha256, "deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef")); cl_assert_equal_i(-1, git_oid_streq(&id_sha256, "deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef"));
...@@ -90,7 +92,9 @@ void test_core_oid__strcmp_sha1(void) ...@@ -90,7 +92,9 @@ void test_core_oid__strcmp_sha1(void)
void test_core_oid__strcmp_sha256(void) void test_core_oid__strcmp_sha256(void)
{ {
#ifdef GIT_EXPERIMENTAL_SHA256 #ifndef GIT_EXPERIMENTAL_SHA256
cl_skip();
#else
cl_assert_equal_i(0, git_oid_strcmp(&id_sha256, str_oid_sha256)); cl_assert_equal_i(0, git_oid_strcmp(&id_sha256, str_oid_sha256));
cl_assert(git_oid_strcmp(&id_sha256, "deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef") < 0); cl_assert(git_oid_strcmp(&id_sha256, "deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef") < 0);
...@@ -129,7 +133,9 @@ void test_core_oid__ncmp_sha1(void) ...@@ -129,7 +133,9 @@ void test_core_oid__ncmp_sha1(void)
void test_core_oid__ncmp_sha256(void) void test_core_oid__ncmp_sha256(void)
{ {
#ifdef GIT_EXPERIMENTAL_SHA256 #ifndef GIT_EXPERIMENTAL_SHA256
cl_skip();
#else
cl_assert(!git_oid_ncmp(&id_sha256, &idp_sha256, 0)); cl_assert(!git_oid_ncmp(&id_sha256, &idp_sha256, 0));
cl_assert(!git_oid_ncmp(&id_sha256, &idp_sha256, 1)); cl_assert(!git_oid_ncmp(&id_sha256, &idp_sha256, 1));
cl_assert(!git_oid_ncmp(&id_sha256, &idp_sha256, 2)); cl_assert(!git_oid_ncmp(&id_sha256, &idp_sha256, 2));
......
...@@ -160,7 +160,9 @@ void test_odb_loose__exists_sha1(void) ...@@ -160,7 +160,9 @@ void test_odb_loose__exists_sha1(void)
void test_odb_loose__exists_sha256(void) void test_odb_loose__exists_sha256(void)
{ {
#ifdef GIT_EXPERIMENTAL_SHA256 #ifndef GIT_EXPERIMENTAL_SHA256
cl_skip();
#else
git_oid id, id2; git_oid id, id2;
git_odb *odb; git_odb *odb;
git_odb_options odb_opts = GIT_ODB_OPTIONS_INIT; git_odb_options odb_opts = GIT_ODB_OPTIONS_INIT;
...@@ -201,7 +203,9 @@ void test_odb_loose__simple_reads_sha1(void) ...@@ -201,7 +203,9 @@ void test_odb_loose__simple_reads_sha1(void)
void test_odb_loose__simple_reads_sha256(void) void test_odb_loose__simple_reads_sha256(void)
{ {
#ifdef GIT_EXPERIMENTAL_SHA256 #ifndef GIT_EXPERIMENTAL_SHA256
cl_skip();
#else
test_read_object(&commit_sha256); test_read_object(&commit_sha256);
test_read_object(&tree_sha256); test_read_object(&tree_sha256);
test_read_object(&tag_sha256); test_read_object(&tag_sha256);
...@@ -230,7 +234,9 @@ void test_odb_loose__streaming_reads_sha1(void) ...@@ -230,7 +234,9 @@ void test_odb_loose__streaming_reads_sha1(void)
void test_odb_loose__streaming_reads_sha256(void) void test_odb_loose__streaming_reads_sha256(void)
{ {
#ifdef GIT_EXPERIMENTAL_SHA256 #ifndef GIT_EXPERIMENTAL_SHA256
cl_skip();
#else
size_t blocksizes[] = { 1, 2, 4, 16, 99, 1024, 123456789 }; size_t blocksizes[] = { 1, 2, 4, 16, 99, 1024, 123456789 };
size_t i; size_t i;
...@@ -259,7 +265,9 @@ void test_odb_loose__read_header_sha1(void) ...@@ -259,7 +265,9 @@ void test_odb_loose__read_header_sha1(void)
void test_odb_loose__read_header_sha256(void) void test_odb_loose__read_header_sha256(void)
{ {
#ifdef GIT_EXPERIMENTAL_SHA256 #ifndef GIT_EXPERIMENTAL_SHA256
cl_skip();
#else
test_read_header(&commit_sha256); test_read_header(&commit_sha256);
test_read_header(&tree_sha256); test_read_header(&tree_sha256);
test_read_header(&tag_sha256); test_read_header(&tag_sha256);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment