aboutsummaryrefslogtreecommitdiff
path: root/test/src/gen/test_seed.c
diff options
context:
space:
mode:
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