aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJ08nY2018-04-05 22:41:05 +0200
committerJ08nY2018-04-07 14:38:24 +0200
commitd9e0c33e375905fcec15f4aea23ac61798415edb (patch)
treee1388a1b91d0879ca948ffa40da4f05c63968840 /test
parent0e4cfed57e2e23c7854b7a3f85efbc952deabcda (diff)
downloadecgen-d9e0c33e375905fcec15f4aea23ac61798415edb.tar.gz
ecgen-d9e0c33e375905fcec15f4aea23ac61798415edb.tar.zst
ecgen-d9e0c33e375905fcec15f4aea23ac61798415edb.zip
Diffstat (limited to 'test')
-rw-r--r--test/src/cm/test_custom.c8
-rw-r--r--test/src/cm/test_p1363.c25
2 files changed, 17 insertions, 16 deletions
diff --git a/test/src/cm/test_custom.c b/test/src/cm/test_custom.c
index 3309de7..dd331e6 100644
--- a/test/src/cm/test_custom.c
+++ b/test/src/cm/test_custom.c
@@ -4,11 +4,11 @@
*/
#include <criterion/criterion.h>
+#include "cm/custom.h"
#include "misc/config.h"
-#include "util/random.h"
#include "test/default.h"
#include "test/input.h"
-#include "cm/custom.h"
+#include "util/random.h"
void custom_setup() {
default_setup();
@@ -16,9 +16,7 @@ void custom_setup() {
random_init();
}
-void custom_teardown() {
- input_teardown();
-}
+void custom_teardown() { input_teardown(); }
TestSuite(custom, .init = custom_setup, .fini = custom_teardown);
diff --git a/test/src/cm/test_p1363.c b/test/src/cm/test_p1363.c
index fdc1823..7bdc6be 100644
--- a/test/src/cm/test_p1363.c
+++ b/test/src/cm/test_p1363.c
@@ -4,9 +4,8 @@
*/
#include <criterion/criterion.h>
-#include "test/default.h"
#include "cm/p1363.h"
-
+#include "test/default.h"
TestSuite(p1363, .init = default_setup, .fini = default_teardown);
@@ -16,18 +15,22 @@ Test(p1363, test_p1363_forms) {
size_t nforms = p1363_forms(D, &forms);
p1363_form_t expected[7] = {
- {gen_1, gen_0, stoi(71)},
- {stoi(3), gen_1, stoi(24)},
- {stoi(3), gen_m1, stoi(24)},
- {stoi(8), gen_1, stoi(9)},
- {stoi(8), gen_m1, stoi(9)},
- {stoi(5), stoi(2), stoi(15)},
- {stoi(5), stoi(-2), stoi(15)}
- };
- cr_assert_eq(nforms, 7,);
+ {gen_1, gen_0, stoi(71)}, {stoi(3), gen_1, stoi(24)},
+ {stoi(3), gen_m1, stoi(24)}, {stoi(8), gen_1, stoi(9)},
+ {stoi(8), gen_m1, stoi(9)}, {stoi(5), stoi(2), stoi(15)},
+ {stoi(5), stoi(-2), stoi(15)}};
+ cr_assert_eq(nforms, 7, );
for (size_t i = 0; i < nforms; ++i) {
cr_assert(equalii(forms[i]->A, expected[i].A), );
cr_assert(equalii(forms[i]->B, expected[i].B), );
cr_assert(equalii(forms[i]->C, expected[i].C), );
}
+}
+
+Test(p1363, test_p1363_poly) {
+ GEN D = stoi(71);
+ p1363_form_t **forms;
+ size_t nforms = p1363_forms(D, &forms);
+ GEN WD = p1363_poly(D, forms, nforms);
+ pari_printf("%Ps\n", WD);
} \ No newline at end of file