summaryrefslogtreecommitdiff
path: root/tests/dumptest.cc
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2011-11-05 18:38:03 (GMT)
committerMarius Kintel <marius@kintel.net>2011-11-05 18:38:03 (GMT)
commitefcbf8e1a20b46081b9348aa9b6536a23b519073 (patch)
treea6cf25a29c211d0abe574c8c8057e48a90e656a6 /tests/dumptest.cc
parentd14a24a2b63d7d3815e02a79ef9dacd76cd01f4d (diff)
Minor refactoring of test code
Diffstat (limited to 'tests/dumptest.cc')
-rw-r--r--tests/dumptest.cc28
1 files changed, 1 insertions, 27 deletions
diff --git a/tests/dumptest.cc b/tests/dumptest.cc
index 7344f95..f35ace3 100644
--- a/tests/dumptest.cc
+++ b/tests/dumptest.cc
@@ -24,8 +24,8 @@
*
*/
+#include "tests-common.h"
#include "openscad.h"
-#include "handle_dep.h"
#include "node.h"
#include "module.h"
#include "context.h"
@@ -54,30 +54,6 @@ QString currentdir;
QString examplesdir;
QString librarydir;
-static AbstractModule *parsefile(const char *filename)
-{
- AbstractModule *root_module = NULL;
-
- QFileInfo fileInfo(filename);
- handle_dep(filename);
- FILE *fp = fopen(filename, "rt");
- if (!fp) {
- fprintf(stderr, "Can't open input file `%s'!\n", filename);
- } else {
- std::stringstream text;
- char buffer[513];
- int ret;
- while ((ret = fread(buffer, 1, 512, fp)) > 0) {
- buffer[ret] = 0;
- text << buffer;
- }
- fclose(fp);
- text << commandline_commands;
- root_module = parse(text.str().c_str(), fileInfo.absolutePath().toLocal8Bit(), false);
- }
- return root_module;
-}
-
int main(int argc, char **argv)
{
if (argc != 3) {
@@ -135,8 +111,6 @@ int main(int argc, char **argv)
AbstractNode::resetIndexCounter();
root_node = root_module->evaluate(&root_ctx, &root_inst);
- // Cache test
- QString teststr("test");
Tree tree;
tree.setRoot(root_node);
contact: Jan Huwald // Impressum