summaryrefslogtreecommitdiffstats
path: root/src/tests/mmftest.cpp
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2025-05-24 13:55:19 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2025-08-02 17:06:04 +0900
commitdfbafdbb2f7369438a750327544f9084a765e407 (patch)
treede1ba6dd129d361f144be77e930e20a3b9e2a541 /src/tests/mmftest.cpp
parentfd118e52e506a25b768214a0af9a4c11cffc9dd3 (diff)
downloadkrecipes-dfbafdbb2f7369438a750327544f9084a765e407.tar.gz
krecipes-dfbafdbb2f7369438a750327544f9084a765e407.zip
Fix importers/exporters bugs. Fix tests and add them to build process.
The file `mx2test.txt` is taken from KRecipes 2.1 source code. Other tests have been adjusted based on the tests in KRecipes 2.1 source code. Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it> Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
Diffstat (limited to 'src/tests/mmftest.cpp')
-rw-r--r--src/tests/mmftest.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/tests/mmftest.cpp b/src/tests/mmftest.cpp
index a534721..b45a9c4 100644
--- a/src/tests/mmftest.cpp
+++ b/src/tests/mmftest.cpp
@@ -118,7 +118,6 @@ main(int argc, char *argv[])
ing7.groupID = 1; ing7.group = "Fat & Liquids";
recipe.ingList.append( ing7 );
-
check( importer, recipe );
RecipeList recipeList;
@@ -127,16 +126,16 @@ main(int argc, char *argv[])
printf("Creating MMFExporter.\n");
MMFExporter exporter("not needed",".mmf");
- check( exporter, recipeList );
+ const char *outfile = "mmftest_output.txt";
+ check( outfile, exporter, recipeList );
printf("Successfully exported recipes to test.txt.\n");
printf("Creating MMFImporter to test exported recipes.\n");
MMFImporter importer2;
- printf("Parsing test.txt.\n");
- TQStringList files2; files2 << "test.txt";
+ printf("Parsing %s.\n", outfile);
+ TQStringList files2; files2 << TQString(outfile);
importer2.parseFiles(files2);
- TQFile::remove("test.txt");
check( importer2, recipe );
printf("Recipe export successful.\n");