Fix unused variable warnings in test cases

This commit is contained in:
Erik Ekman 2014-01-29 22:41:24 +01:00
parent b0e41e82e4
commit f11328306d
2 changed files with 4 additions and 0 deletions

View File

@ -50,6 +50,7 @@ START_TEST(test_base32_encode)
len = sizeof(buf); len = sizeof(buf);
val = b32->encode(buf, &len, testpairs[_i].a, strlen(testpairs[_i].a)); val = b32->encode(buf, &len, testpairs[_i].a, strlen(testpairs[_i].a));
fail_unless(val == strlen(testpairs[_i].b));
fail_unless(strcmp(buf, testpairs[_i].b) == 0, fail_unless(strcmp(buf, testpairs[_i].b) == 0,
"'%s' != '%s'", buf, testpairs[_i].b); "'%s' != '%s'", buf, testpairs[_i].b);
} }
@ -67,6 +68,7 @@ START_TEST(test_base32_decode)
len = sizeof(buf); len = sizeof(buf);
val = b32->decode(buf, &len, testpairs[_i].b, strlen(testpairs[_i].b)); val = b32->decode(buf, &len, testpairs[_i].b, strlen(testpairs[_i].b));
fail_unless(val == strlen(testpairs[_i].a));
fail_unless(strcmp(buf, testpairs[_i].a) == 0, fail_unless(strcmp(buf, testpairs[_i].a) == 0,
"'%s' != '%s'", buf, testpairs[_i].a); "'%s' != '%s'", buf, testpairs[_i].a);
} }

View File

@ -76,6 +76,7 @@ START_TEST(test_base64_encode)
len = sizeof(buf); len = sizeof(buf);
val = b64->encode(buf, &len, testpairs[_i].a, strlen(testpairs[_i].a)); val = b64->encode(buf, &len, testpairs[_i].a, strlen(testpairs[_i].a));
fail_unless(val == strlen(testpairs[_i].b));
fail_unless(strcmp(buf, testpairs[_i].b) == 0, fail_unless(strcmp(buf, testpairs[_i].b) == 0,
"'%s' != '%s'", buf, testpairs[_i].b); "'%s' != '%s'", buf, testpairs[_i].b);
} }
@ -93,6 +94,7 @@ START_TEST(test_base64_decode)
len = sizeof(buf); len = sizeof(buf);
val = b64->decode(buf, &len, testpairs[_i].b, strlen(testpairs[_i].b)); val = b64->decode(buf, &len, testpairs[_i].b, strlen(testpairs[_i].b));
fail_unless(val == strlen(testpairs[_i].a));
fail_unless(strcmp(buf, testpairs[_i].a) == 0, fail_unless(strcmp(buf, testpairs[_i].a) == 0,
"'%s' != '%s'", buf, testpairs[_i].a); "'%s' != '%s'", buf, testpairs[_i].a);
} }