This commit is contained in:
Zhi Guan
2022-04-11 17:56:25 +08:00
parent c21972168d
commit 7e4dd76839
45 changed files with 5221 additions and 2979 deletions

View File

@@ -74,10 +74,10 @@ static int test_x509_directory_name(void)
|| asn1_check(memcmp(str, d, dlen) == 0) != 1
|| asn1_length_is_zero(len) != 1) {
error_print();
return 1;
return -1;
}
printf("%s() ok\n", __FUNCTION__);
return 0;
return 1;
}
static int test_x509_display_text(void)
@@ -99,16 +99,19 @@ static int test_x509_display_text(void)
|| asn1_check(memcmp(str, d, dlen) == 0) != 1
|| asn1_length_is_zero(len) != 1) {
error_print();
return 1;
return -1;
}
printf("%s() ok\n", __FUNCTION__);
return 0;
return 1;
}
int main(void)
{
int err = 0;
err += test_x509_directory_name();
err += test_x509_display_text();
return err;
if (test_x509_directory_name() != 1) goto err;
if (test_x509_display_text() != 1) goto err;
printf("%s all tests passed!\n", __FILE__);
return 0;
err:
error_print();
return 1;
}