From 62d87e063318cc4c842b1b2d8c184f48aeaf6659 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Mon, 19 May 2025 17:45:14 +0200 Subject: Refactored checkdata Relevant changes include: - Changed the signature of nissy_checkdata(). - Removed expected_distribution.h from tools; this data is now included in each solver's src/ code. - Removed distribution check for cocsep; may add back later. --- tools/000_gendata/gendata.c | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) (limited to 'tools/000_gendata') diff --git a/tools/000_gendata/gendata.c b/tools/000_gendata/gendata.c index 66c4864..f2da890 100644 --- a/tools/000_gendata/gendata.c +++ b/tools/000_gendata/gendata.c @@ -1,13 +1,10 @@ #include "../tool.h" -#include "../expected_distributions.h" char *solver; -uint64_t *expected; static void run(void) { int64_t size; - bool consistent, expected; char filename[1024], dataid[NISSY_SIZE_DATAID]; unsigned char *buf; @@ -18,20 +15,14 @@ run(void) { case -2: goto gendata_run_finish; default: - nissy_datainfo(size, buf); - consistent = nissy_checkdata(size, buf) == 0; - expected = check_distribution(solver, size, buf); - if (consistent && expected) { + if (nissy_checkdata(solver, size, buf) == NISSY_OK) { printf("\n"); printf("Generated %" PRId64 " bytes.\n", size); sprintf(filename, "tables/%s", dataid); writetable(buf, size, filename); + } else { + printf("Error: table generated incorrectly!\n"); } - if (!consistent) - printf("Error: table is not consistent with info" - " (nissy_checkdata() failed)\n"); - if (!expected) - printf("Error: distribution is not as expected\n"); break; } @@ -40,8 +31,6 @@ gendata_run_finish: } int main(int argc, char **argv) { - uint8_t h, k; - if (argc < 2) { printf("Error: not enough arguments. " "A solver must be given.\n"); @@ -49,11 +38,7 @@ int main(int argc, char **argv) { } solver = argv[1]; - parse_h48_hk(solver, &h, &k); - expected = expected_h48[h][k]; - nissy_setlogger(log_stderr, NULL); - timerun(run); return 0; -- cgit v1.3