summaryrefslogtreecommitdiff
path: root/tests/dumptest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'tests/dumptest.cc')
-rw-r--r--tests/dumptest.cc21
1 files changed, 10 insertions, 11 deletions
diff --git a/tests/dumptest.cc b/tests/dumptest.cc
index 4b1d907..bc48011 100644
--- a/tests/dumptest.cc
+++ b/tests/dumptest.cc
@@ -36,9 +36,6 @@
#include "Tree.h"
#include <QApplication>
-#include <QFile>
-#include <QDir>
-#include <QSet>
#ifndef _MSC_VER
#include <getopt.h>
#endif
@@ -47,12 +44,15 @@
#include <sstream>
#include <fstream>
-using std::string;
+#include <boost/filesystem.hpp>
+namespace fs = boost::filesystem;
std::string commandline_commands;
-QString currentdir;
+std::string currentdir;
QString examplesdir;
+using std::string;
+
string dumptree(const Tree &tree, const AbstractNode &node)
{
std::stringstream str;
@@ -82,9 +82,9 @@ int main(int argc, char **argv)
Builtins::instance()->initialize();
QApplication app(argc, argv, false);
- QDir original_path = QDir::current();
+ fs::path original_path = fs::current_path();
- currentdir = QDir::currentPath();
+ currentdir = fs::current_path().generic_string();
parser_init();
@@ -100,8 +100,7 @@ int main(int argc, char **argv)
exit(1);
}
- QFileInfo fileInfo(filename);
- QDir::setCurrent(fileInfo.absolutePath());
+ fs::current_path(fs::path(filename).parent_path());
AbstractNode::resetIndexCounter();
root_node = root_module->evaluate(&root_ctx, &root_inst);
@@ -116,7 +115,7 @@ int main(int argc, char **argv)
exit(1);
}
- QDir::setCurrent(original_path.absolutePath());
+ fs::current_path(original_path);
std::ofstream outfile;
outfile.open(outfilename);
outfile << dumpstdstr << "\n";
@@ -130,7 +129,7 @@ int main(int argc, char **argv)
fprintf(stderr, "Error: Unable to read back dumped file\n");
exit(1);
}
- QDir::setCurrent(fileInfo.absolutePath());
+ fs::current_path(original_path);
AbstractNode::resetIndexCounter();
root_node = root_module->evaluate(&root_ctx, &root_inst);
contact: Jan Huwald // Impressum