summaryrefslogtreecommitdiffstats
path: root/test/test_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_test.c')
-rw-r--r--test/test_test.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/test/test_test.c b/test/test_test.c
index a1b04561b3..051058fffe 100644
--- a/test/test_test.c
+++ b/test/test_test.c
@@ -477,6 +477,38 @@ static int test_single_eval(void)
&& TEST_mem_eq(p--, sizeof("456"), "456", sizeof("456"));
}
+static int test_output(void)
+{
+ const char s[] = "1234567890123456789012345678901234567890123456789012"
+ "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
+
+ test_output_string("test", s, sizeof(s) - 1);
+ test_output_memory("test", (const unsigned char *)s, sizeof(s));
+ return 1;
+}
+
+static const char *bn_output_tests[] = {
+ NULL,
+ "0",
+ "-12345678",
+ "1234567890123456789012345678901234567890123456789012"
+ "1234567890123456789012345678901234567890123456789013"
+ "987657"
+};
+
+static int test_bn_output(int n)
+{
+ BIGNUM *b = NULL;
+
+ if (bn_output_tests[n] != NULL
+ && !TEST_true(BN_hex2bn(&b, bn_output_tests[n])))
+ return 0;
+ test_output_bignum(bn_output_tests[n], b);
+ BN_free(b);
+ return 1;
+}
+
+
void register_tests(void)
{
ADD_TEST(test_int);
@@ -496,4 +528,6 @@ void register_tests(void)
ADD_TEST(test_long_output);
ADD_TEST(test_messages);
ADD_TEST(test_single_eval);
+ ADD_TEST(test_output);
+ ADD_ALL_TESTS(test_bn_output, OSSL_NELEM(bn_output_tests));
}