From be1ab24251025ab7321505f01596fc54efc0b3d3 Mon Sep 17 00:00:00 2001 From: Matteo Cypriani Date: Sat, 22 Jun 2013 17:12:09 -0400 Subject: [PATCH] [Positioner] tests: delete userinterface_test.hh UserInterface is no longer testable, since we need a valid configuration to test the other classes. --- owlps-positioner/tests/userinterface_test.hh | 75 -------------------- 1 file changed, 75 deletions(-) delete mode 100644 owlps-positioner/tests/userinterface_test.hh diff --git a/owlps-positioner/tests/userinterface_test.hh b/owlps-positioner/tests/userinterface_test.hh deleted file mode 100644 index 456ab8d..0000000 --- a/owlps-positioner/tests/userinterface_test.hh +++ /dev/null @@ -1,75 +0,0 @@ -#include - -#include "userinterface.hh" - -#include -#include - -class UserInterface_test: public CxxTest::TestSuite -{ -private: - std::string config_file_name ; - std::vector config_lines ; // Test config file contents - -public: - - UserInterface_test(void) - { - // If we cannot open the file, we want to stop the test - CxxTest::setAbortTestOnFail(true) ; - - // Fill name and contents of the test config file - config_file_name = "/tmp/UserInterface_test_config_file.csv" ; - config_lines.push_back("\n") ; - config_lines.push_back("[input]\n") ; - config_lines.push_back("\n") ; - config_lines.push_back("udp-port = 42\n") ; - config_lines.push_back("\n") ; - TestUtil::fill_file(config_file_name, config_lines) ; - - // Back to the normal behaviour (i.e. do not abort on fail) - CxxTest::setAbortTestOnFail(false) ; - } - - - ~UserInterface_test(void) - { - // Delete the test config file - TestUtil::remove_file(config_file_name) ; - } - - - static UserInterface_test* createSuite(void) - { - return new UserInterface_test() ; - } - - - static void destroySuite(UserInterface_test *suite) - { - delete suite ; - } - - - void test_constructors(void) - { - // Note: as --help makes the program exit, we cannot test it. - const char *argv[] = - { - "owlps-positionerd", // program name - "--config-file", - config_file_name.c_str() - } ; - int argc = 3 ; - - UserInterface ui(argc, argv) ; - - TS_ASSERT(Configuration::is_configured("input.udp-port")) ; - TS_ASSERT(Configuration::is_configured("config-file")) ; - - TS_ASSERT_EQUALS(Configuration::int_value("input.udp-port"), 42) ; - TS_ASSERT_EQUALS(Configuration::string_value("config-file"), - config_file_name) ; - } - -} ;