diff options
Diffstat (limited to 'test/src/gen/test_curve.c')
| -rw-r--r-- | test/src/gen/test_curve.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/test/src/gen/test_curve.c b/test/src/gen/test_curve.c new file mode 100644 index 0000000..3fe4801 --- /dev/null +++ b/test/src/gen/test_curve.c @@ -0,0 +1,36 @@ +/* + * ecgen, tool for generating Elliptic curve domain parameters + * Copyright (C) 2017 J08nY + */ +#include <criterion/criterion.h> +#include "gen/curve.h" +#include "test/default.h" + +TestSuite(curve, .init = default_setup, .fini = default_teardown); + +Test(curve, test_curve_new) { + curve_t *curve = curve_new(); + cr_assert_not_null(curve, ); + curve_free(&curve); + cr_assert_null(curve, ); +} + +Test(curve, test_curve_copy) { + curve_t *curve = curve_new(); + curve_t *other = curve_new_copy(curve); + cr_assert_not_null(other, ); + curve_copy(curve, other); + cr_assert_not_null(other, ); + curve_free(&curve); + curve_free(&other); +} + +Test(curve, test_curve_clone) { + curve_t *curve = curve_new(); + curve_t *other = curve_new_clone(curve); + cr_assert_not_null(other, ); + curve_clone(curve, other); + cr_assert_not_null(other, ); + curve_free(&curve); + curve_free(&other); +}
\ No newline at end of file |
