diff options
-rw-r--r-- | project2/basics/unittests/testViews.cpp | 10 | ||||
-rw-r--r-- | project2/files/unittests/testConfig.cpp | 6 | ||||
-rw-r--r-- | project2/ut/definedDirs.h | 17 | ||||
-rw-r--r-- | project2/xml/unittests/testxml.cpp | 4 |
4 files changed, 10 insertions, 27 deletions
diff --git a/project2/basics/unittests/testViews.cpp b/project2/basics/unittests/testViews.cpp index a2ea224..0a05c69 100644 --- a/project2/basics/unittests/testViews.cpp +++ b/project2/basics/unittests/testViews.cpp @@ -11,8 +11,8 @@ boost::intrusive_ptr<TestScriptHost> executeRowViewTest(ExecContext * ec, const boost::filesystem::path & script, const boost::filesystem::path & expected) { TestOptionsSource::LoadTestOptions({ - { "common.datasourceRoot", RootDir.string() }, - { "application.dataroot", ("file://" / RootDir / "data").string() }, + { "common.datasourceRoot", rootDir.string() }, + { "application.dataroot", ("file://" / rootDir / "data").string() }, }); BOOST_TEST_CHECKPOINT("Load"); ScriptReaderPtr r = new XmlScriptParser(script); @@ -28,17 +28,17 @@ BOOST_FIXTURE_TEST_SUITE( Core, TestAppInstance ); BOOST_AUTO_TEST_CASE( test_rowview_unsetcolumns ) { - executeRowViewTest(this, RootDir / "test_rowview_unsetcolumns.xml", RootDir / "expected" / "test_rowview_unsetcolumns.log"); + executeRowViewTest(this, rootDir / "test_rowview_unsetcolumns.xml", rootDir / "expected" / "test_rowview_unsetcolumns.log"); } BOOST_AUTO_TEST_CASE( test_rowview_nocolumns ) { - executeRowViewTest(this, RootDir / "test_rowview_nocolumns.xml", RootDir / "expected" / "test_rowview_nocolumns.log"); + executeRowViewTest(this, rootDir / "test_rowview_nocolumns.xml", rootDir / "expected" / "test_rowview_nocolumns.log"); } BOOST_AUTO_TEST_CASE( test_rowview_columns ) { - executeRowViewTest(this, RootDir / "test_rowview_columns.xml", RootDir / "expected" / "test_rowview_columns.log"); + executeRowViewTest(this, rootDir / "test_rowview_columns.xml", rootDir / "expected" / "test_rowview_columns.log"); } BOOST_AUTO_TEST_SUITE_END(); diff --git a/project2/files/unittests/testConfig.cpp b/project2/files/unittests/testConfig.cpp index 6880824..2933f9b 100644 --- a/project2/files/unittests/testConfig.cpp +++ b/project2/files/unittests/testConfig.cpp @@ -31,7 +31,7 @@ class TestConfigConsumer : public ConfigConsumer { BOOST_AUTO_TEST_CASE( readMissingFile ) { TestConfigConsumer options; - OptionsSourcePtr file = OptionsSourcePtr(new FileOptions(RootDir / "nothere.config")); + OptionsSourcePtr file = OptionsSourcePtr(new FileOptions(rootDir / "nothere.config")); file->loadInto(options, []() { return Glib::ustring(); }); BOOST_REQUIRE(options.options.empty()); } @@ -39,8 +39,8 @@ BOOST_AUTO_TEST_CASE( readMissingFile ) BOOST_AUTO_TEST_CASE( readConfigFile ) { TestConfigConsumer options; - BOOST_REQUIRE(boost::filesystem::exists(RootDir / "test.config")); - OptionsSourcePtr file = OptionsSourcePtr(new FileOptions(RootDir / "test.config")); + BOOST_REQUIRE(boost::filesystem::exists(rootDir / "test.config")); + OptionsSourcePtr file = OptionsSourcePtr(new FileOptions(rootDir / "test.config")); file->loadInto(options, []() { return Glib::ustring(); }); // Count BOOST_REQUIRE_EQUAL(12, options.options.size()); diff --git a/project2/ut/definedDirs.h b/project2/ut/definedDirs.h deleted file mode 100644 index cbed012..0000000 --- a/project2/ut/definedDirs.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef P2_UT_DEFINEDDIRS -#define P2_UT_DEFINEDDIRS - -#include <boost/filesystem/path.hpp> -#include <boost/filesystem/convenience.hpp> - -#ifndef ROOT -#error "ROOT needs to be defined at compilation time" -#endif - -#define XSTR(s) STR(s) -#define STR(s) #s -const auto BinDir = boost::filesystem::canonical("/proc/self/exe").parent_path(); -const boost::filesystem::path RootDir(XSTR(ROOT)); - -#endif - diff --git a/project2/xml/unittests/testxml.cpp b/project2/xml/unittests/testxml.cpp index 143f501..a3a40e0 100644 --- a/project2/xml/unittests/testxml.cpp +++ b/project2/xml/unittests/testxml.cpp @@ -27,7 +27,7 @@ BOOST_AUTO_TEST_CASE( before ) BOOST_AUTO_TEST_CASE( rawview ) { TestOptionsSource::LoadTestOptions({ }); - ScriptReaderPtr s = new XmlScriptParser(RootDir / "rawview.xml"); + ScriptReaderPtr s = new XmlScriptParser(rootDir / "rawview.xml"); boost::intrusive_ptr<TestScriptHost> h = new TestScriptHost(s); h->executeViews(NULL); auto p = boost::dynamic_pointer_cast<XmlPresenter>(h->getPresenter(NULL)); @@ -38,7 +38,7 @@ BOOST_AUTO_TEST_CASE( rawview ) p->writeTo(strm, "utf-8", NULL); BOOST_REQUIRE_EQUAL(0, systembf("diff -w --unified %s %s", out, - RootDir / "expected" / "rawview.xml")); + rootDir / "expected" / "rawview.xml")); boost::filesystem::remove_all(tmpdir); } |