From eb30f55ccce35a258d27f12ab036bf63453ac3da Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Mon, 29 Aug 2022 00:27:32 -0400 Subject: Add result export for mingui. --- tests/testdrive.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests') diff --git a/tests/testdrive.cpp b/tests/testdrive.cpp index b57d792..c0d1038 100644 --- a/tests/testdrive.cpp +++ b/tests/testdrive.cpp @@ -268,10 +268,22 @@ int main(int argc,char** argv) signatures.resize(files.size()); run(); + FILE *outf = fopen("result", "wb"); for(auto &p : out) { printf("%s %s %f\n", files[p.first].c_str(), files[p.second].c_str(), signatures[p.first].distance(signatures[p.second])); + int t; + double ts; + t = (int)files[p.first].length(); + fwrite(&t, sizeof(int), 1, outf); + fwrite(files[p.first].c_str(), 1, files[p.first].length(), outf); + t = (int)files[p.second].length(); + fwrite(&t, sizeof(int), 1, outf); + fwrite(files[p.second].c_str(), 1, files[p.second].length(), outf); + ts = signatures[p.first].distance(signatures[p.second]); + fwrite(&ts, sizeof(double), 1, outf); } + fclose(outf); return 0; } -- cgit v1.2.3