diff options
| author | J08nY | 2018-01-18 22:07:34 +0100 |
|---|---|---|
| committer | J08nY | 2018-01-18 23:38:40 +0100 |
| commit | 77a4a7c2af7aad72e699018fcda8e4cb52d377e6 (patch) | |
| tree | 8755e6b3d1c0e856252dfc8fe37b1c727606a812 /test/src/gen/test_point.c | |
| parent | b03007db7612a6d9ab70cd0e698de565a9687ddf (diff) | |
| download | ecgen-77a4a7c2af7aad72e699018fcda8e4cb52d377e6.tar.gz ecgen-77a4a7c2af7aad72e699018fcda8e4cb52d377e6.tar.zst ecgen-77a4a7c2af7aad72e699018fcda8e4cb52d377e6.zip | |
Add some more basic tests for coverage.
Diffstat (limited to 'test/src/gen/test_point.c')
| -rw-r--r-- | test/src/gen/test_point.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/src/gen/test_point.c b/test/src/gen/test_point.c index 19869c5..ca23ba6 100644 --- a/test/src/gen/test_point.c +++ b/test/src/gen/test_point.c @@ -9,6 +9,28 @@ TestSuite(point, .init = io_setup, .fini = io_teardown); +Test(point, test_point_clone) { + point_t *one = point_new(); + point_t *other = point_new_clone(one); + cr_assert_not_null(other, ); + point_clone(one, other); + cr_assert_not_null(other, ); + point_free(&one); + point_free(&other); +} + +Test(point, test_points_clone) { + point_t *one = point_new(); + point_t **points = points_new(1); + points[0] = one; + point_t **others = points_new_clone(points, 1); + cr_assert_not_null(others, ); + points_clone(points, others, 1); + cr_assert_not_null(others, ); + points_free_deep(&points, 1); + points_free_deep(&others, 1); +} + Test(point, test_point_random) { // curve = ellinit([1, 3], 23), order = 27 GEN e = ellinit(mkvec2s(1, 3), stoi(23), -1); |
