aboutsummaryrefslogtreecommitdiff
path: root/test/src/gen/test_seed.c
diff options
context:
space:
mode:
authorJ08nY2018-01-18 22:07:34 +0100
committerJ08nY2018-01-18 23:38:40 +0100
commit77a4a7c2af7aad72e699018fcda8e4cb52d377e6 (patch)
tree8755e6b3d1c0e856252dfc8fe37b1c727606a812 /test/src/gen/test_seed.c
parentb03007db7612a6d9ab70cd0e698de565a9687ddf (diff)
downloadecgen-77a4a7c2af7aad72e699018fcda8e4cb52d377e6.tar.gz
ecgen-77a4a7c2af7aad72e699018fcda8e4cb52d377e6.tar.zst
ecgen-77a4a7c2af7aad72e699018fcda8e4cb52d377e6.zip
Add some more basic tests for coverage.
Diffstat (limited to 'test/src/gen/test_seed.c')
-rw-r--r--test/src/gen/test_seed.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/src/gen/test_seed.c b/test/src/gen/test_seed.c
new file mode 100644
index 0000000..807db31
--- /dev/null
+++ b/test/src/gen/test_seed.c
@@ -0,0 +1,36 @@
+/*
+ * ecgen, tool for generating Elliptic seed domain parameters
+ * Copyright (C) 2017 J08nY
+ */
+#include <criterion/criterion.h>
+#include "gen/seed.h"
+#include "test/default.h"
+
+TestSuite(seed, .init = default_setup, .fini = default_teardown);
+
+Test(seed, test_seed_new) {
+ seed_t *seed = seed_new();
+ cr_assert_not_null(seed, );
+ seed_free(&seed);
+ cr_assert_null(seed, );
+}
+
+Test(seed, test_seed_copy) {
+ seed_t *seed = seed_new();
+ seed_t *other = seed_new_copy(seed);
+ cr_assert_not_null(other, );
+ seed_copy(seed, other);
+ cr_assert_not_null(other, );
+ seed_free(&seed);
+ seed_free(&other);
+}
+
+Test(seed, test_seed_clone) {
+ seed_t *seed = seed_new();
+ seed_t *other = seed_new_clone(seed);
+ cr_assert_not_null(other, );
+ seed_clone(seed, other);
+ cr_assert_not_null(other, );
+ seed_free(&seed);
+ seed_free(&other);
+} \ No newline at end of file