aboutsummaryrefslogtreecommitdiff
path: root/tools/100_checkdata/checkdata.c
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2025-05-19 17:45:14 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2025-05-19 17:45:14 +0200
commit62d87e063318cc4c842b1b2d8c184f48aeaf6659 (patch)
tree832bf338232c477975bea69f7370ca13f350fb07 /tools/100_checkdata/checkdata.c
parent8b94d135429a9f3253cc7f25a1453b412065c4a0 (diff)
downloadnissy-core-62d87e063318cc4c842b1b2d8c184f48aeaf6659.tar.gz
nissy-core-62d87e063318cc4c842b1b2d8c184f48aeaf6659.zip
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.
Diffstat (limited to 'tools/100_checkdata/checkdata.c')
-rw-r--r--tools/100_checkdata/checkdata.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/tools/100_checkdata/checkdata.c b/tools/100_checkdata/checkdata.c
index c284aa4..3a3c098 100644
--- a/tools/100_checkdata/checkdata.c
+++ b/tools/100_checkdata/checkdata.c
@@ -1,11 +1,11 @@
1#include "../tool.h" 1#include "../tool.h"
2#include "../expected_distributions.h"
3 2
4char *solver, *filename; 3char *solver, *filename;
5 4
6static void 5static void
7run(void) { 6run(void) {
8 long long int size, sizeread, result; 7 bool result;
8 long long int size, sizeread;
9 char dataid[NISSY_SIZE_DATAID]; 9 char dataid[NISSY_SIZE_DATAID];
10 unsigned char *buf; 10 unsigned char *buf;
11 FILE *f; 11 FILE *f;
@@ -25,10 +25,12 @@ run(void) {
25 buf = malloc(size); 25 buf = malloc(size);
26 sizeread = fread(buf, size, 1, f); 26 sizeread = fread(buf, size, 1, f);
27 fclose(f); 27 fclose(f);
28 result = sizeread == 1 && nissy_checkdata(size, buf); 28 if (sizeread != 1)
29 printf("File has unexpected size\n");
30 result = sizeread == 1 && nissy_checkdata(solver, size, buf) == NISSY_OK;
29 free(buf); 31 free(buf);
30 32
31 printf("checkdata %s\n", result == 0 ? "succeeded" : "failed"); 33 printf("checkdata %s\n", result ? "succeeded" : "failed");
32 34
33 /* TODO: cross-check with expected distributions? */ 35 /* TODO: cross-check with expected distributions? */
34} 36}

Generated with cgit - Back to sebastiano.tronto.net