diff options
Diffstat (limited to 'src/tests/rezkonvtest.cpp')
| -rw-r--r-- | src/tests/rezkonvtest.cpp | 49 |
1 files changed, 43 insertions, 6 deletions
diff --git a/src/tests/rezkonvtest.cpp b/src/tests/rezkonvtest.cpp index f2773ce..b4430d1 100644 --- a/src/tests/rezkonvtest.cpp +++ b/src/tests/rezkonvtest.cpp @@ -46,7 +46,7 @@ main(int argc, char *argv[]) recipe.categoryList.append( Element("Snacks") ); recipe.categoryList.append( Element("Cookies & Squares") ); recipe.instructions = - "\n\nDrop by spoonful on greased cookie sheet. Bake in moderate oven."; + "Drop by spoonful on greased cookie sheet. Bake in moderate oven."; recipe.authorList.append( Element("Mona Beamer") ); recipe.authorList.append( Element("Colleen Beamer") ); @@ -143,16 +143,53 @@ main(int argc, char *argv[]) printf("Creating RezkonvExporter.\n"); RezkonvExporter exporter("not needed",".rk"); - check( exporter, recipeList ); - printf("Successfully exported recipes to test.txt.\n"); + const char *outfile = "rezkonvtest_output.txt"; + check( outfile , exporter, recipeList ); + printf("Successfully exported recipes to %s.\n", outfile); printf("Creating RezkonvImporter to test exported recipes.\n"); RezkonvImporter 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"); + + + //We need to change some strings from english to german because rezkonv + //export format is supposed to provide unit names in german. + recipe.ingList.clear(); + ing9.substitutes.clear(); + + ing9.units.name = "Tassen"; + ing9_1.units.plural = "Tasse"; + ing9_2.units.plural = "Tasse"; + ing9.substitutes.append(ing9_1); + ing9.substitutes.append(ing9_2); + recipe.ingList.append( ing9 ); + + ing.units.name = "Tassen"; + recipe.ingList.append( ing ); + + ing2.units.name = "Tassen"; + recipe.ingList.append( ing2 ); + + ing3.units.plural = "Tasse"; + recipe.ingList.append( ing3 ); + + ing4.units.name = "Teel."; + recipe.ingList.append( ing4 ); + + ing8.units.name = "Tassen"; + recipe.ingList.append( ing8 ); + + ing6.units.name = "Tassen"; + recipe.ingList.append( ing6 ); + + recipe.ingList.append( ing5 ); + + ing7.units.name = "Teel."; + recipe.ingList.append( ing7 ); + check( importer2, recipe ); printf("Recipe export successful.\n"); |
