aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2022-08-29 00:27:32 -0400
committerGravatar Chris Xiong <chirs241097@gmail.com> 2022-08-29 00:27:32 -0400
commiteb30f55ccce35a258d27f12ab036bf63453ac3da (patch)
tree473a00d89fa56cf444b50920da630983ab5036ed
parente679bf14a12b51554abe812026d9699451d53f1f (diff)
downloaddeduper-eb30f55ccce35a258d27f12ab036bf63453ac3da.tar.xz
Add result export for mingui.
-rw-r--r--tests/testdrive.cpp12
1 files changed, 12 insertions, 0 deletions
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;
}