Changed test function call, uses internal AssertIntEQ instead of single call

This commit is contained in:
Ethan Looney
2020-09-23 13:22:59 -06:00
parent 1d4e7d8278
commit 59294708a8

View File

@@ -23253,9 +23253,8 @@ static void test_PKCS7_signed_enveloped(void)
#endif #endif
} }
static int test_wc_PKCS7_NoDefaultSignedAttribs (void) static void test_wc_PKCS7_NoDefaultSignedAttribs (void)
{ {
int ret = 0;
#if defined(HAVE_PKCS7) && !defined(NO_FILESYSTEM) && !defined(NO_RSA) \ #if defined(HAVE_PKCS7) && !defined(NO_FILESYSTEM) && !defined(NO_RSA) \
&& !defined(NO_AES) && !defined(NO_AES)
PKCS7* pkcs7; PKCS7* pkcs7;
@@ -23267,22 +23266,17 @@ static int test_wc_PKCS7_NoDefaultSignedAttribs (void)
AssertNotNull(pkcs7); AssertNotNull(pkcs7);
AssertIntEQ(wc_PKCS7_Init(pkcs7, heap, devId), 0); AssertIntEQ(wc_PKCS7_Init(pkcs7, heap, devId), 0);
ret = wc_PKCS7_NoDefaultSignedAttribs(NULL); AssertIntEQ(wc_PKCS7_NoDefaultSignedAttribs(NULL), BAD_FUNC_ARG);
if (ret == BAD_FUNC_ARG) {
ret = 0; AssertIntEQ(wc_PKCS7_NoDefaultSignedAttribs(pkcs7), 0);
}
if (ret == 0) {
ret = wc_PKCS7_NoDefaultSignedAttribs(pkcs7);
}
wc_PKCS7_Free(pkcs7); wc_PKCS7_Free(pkcs7);
printf(resultFmt, ret == 0 ? passed : failed);
printf(resultFmt, passed);
#endif #endif
return ret;
} }
static int test_wc_PKCS7_SetOriEncryptCtx (void) static void test_wc_PKCS7_SetOriEncryptCtx (void)
{ {
int ret = 0;
#if defined(HAVE_PKCS7) && !defined(NO_FILESYSTEM) && !defined(NO_RSA) \ #if defined(HAVE_PKCS7) && !defined(NO_FILESYSTEM) && !defined(NO_RSA) \
&& !defined(NO_AES) && !defined(NO_AES)
PKCS7* pkcs7; PKCS7* pkcs7;
@@ -23296,22 +23290,17 @@ static int test_wc_PKCS7_SetOriEncryptCtx (void)
AssertNotNull(pkcs7); AssertNotNull(pkcs7);
AssertIntEQ(wc_PKCS7_Init(pkcs7, heap, devId), 0); AssertIntEQ(wc_PKCS7_Init(pkcs7, heap, devId), 0);
ret = wc_PKCS7_SetOriEncryptCtx(NULL, ctx); AssertIntEQ(wc_PKCS7_SetOriEncryptCtx(NULL, ctx), BAD_FUNC_ARG);
if (ret == BAD_FUNC_ARG) {
ret = 0; AssertIntEQ(wc_PKCS7_SetOriEncryptCtx(pkcs7, ctx), 0);
}
if (ret == 0) {
ret = wc_PKCS7_SetOriEncryptCtx(pkcs7, ctx);
}
wc_PKCS7_Free(pkcs7); wc_PKCS7_Free(pkcs7);
printf(resultFmt, ret == 0 ? passed : failed);
printf(resultFmt, passed);
#endif #endif
return ret;
} }
static int test_wc_PKCS7_SetOriDecryptCtx (void) static void test_wc_PKCS7_SetOriDecryptCtx (void)
{ {
int ret = 0;
#if defined(HAVE_PKCS7) && !defined(NO_FILESYSTEM) && !defined(NO_RSA) \ #if defined(HAVE_PKCS7) && !defined(NO_FILESYSTEM) && !defined(NO_RSA) \
&& !defined(NO_AES) && !defined(NO_AES)
PKCS7* pkcs7; PKCS7* pkcs7;
@@ -23325,18 +23314,13 @@ static int test_wc_PKCS7_SetOriDecryptCtx (void)
AssertNotNull(pkcs7); AssertNotNull(pkcs7);
AssertIntEQ(wc_PKCS7_Init(pkcs7, heap, devId), 0); AssertIntEQ(wc_PKCS7_Init(pkcs7, heap, devId), 0);
ret = wc_PKCS7_SetOriDecryptCtx(NULL, ctx); AssertIntEQ(wc_PKCS7_SetOriDecryptCtx(NULL, ctx), BAD_FUNC_ARG);
if (ret == BAD_FUNC_ARG) {
ret = 0; AssertIntEQ(wc_PKCS7_SetOriDecryptCtx(pkcs7, ctx), 0);
}
if (ret == 0) {
ret = wc_PKCS7_SetOriDecryptCtx(pkcs7, ctx);
}
wc_PKCS7_Free(pkcs7); wc_PKCS7_Free(pkcs7);
printf(resultFmt, ret == 0 ? passed : failed); printf(resultFmt, passed);
#endif #endif
return ret;
} }
static void test_wc_i2d_PKCS12(void) static void test_wc_i2d_PKCS12(void)
{ {
@@ -37006,9 +36990,9 @@ void ApiTest(void)
test_wc_PKCS7_Degenerate(); test_wc_PKCS7_Degenerate();
test_wc_PKCS7_BER(); test_wc_PKCS7_BER();
test_PKCS7_signed_enveloped(); test_PKCS7_signed_enveloped();
AssertIntEQ(test_wc_PKCS7_NoDefaultSignedAttribs(), 0); test_wc_PKCS7_NoDefaultSignedAttribs();
AssertIntEQ(test_wc_PKCS7_SetOriDecryptCtx(), 0); test_wc_PKCS7_SetOriEncryptCtx();
AssertIntEQ(test_wc_PKCS7_SetOriEncryptCtx(), 0); test_wc_PKCS7_SetOriDecryptCtx();
test_wc_i2d_PKCS12(); test_wc_i2d_PKCS12();