From: <den...@us...> - 2009-12-28 15:33:45
|
Revision: 68 http://stdair.svn.sourceforge.net/stdair/?rev=68&view=rev Author: denis_arnaud Date: 2009-12-28 15:33:39 +0000 (Mon, 28 Dec 2009) Log Message: ----------- [Test] Moved the tests into a sub-directory labelled 'stdair', so as to allow for sharing them. Modified Paths: -------------- trunk/stdair/configure.ac trunk/stdair/test/Makefile.am Added Paths: ----------- trunk/stdair/test/stdair/ trunk/stdair/test/stdair/Makefile.am trunk/stdair/test/stdair/StandardAirlineITTestSuite.cpp trunk/stdair/test/stdair/StandardAirlineITTestSuite.hpp trunk/stdair/test/stdair/inheritance/ Removed Paths: ------------- trunk/stdair/test/StandardAirlineITTestSuite.cpp trunk/stdair/test/StandardAirlineITTestSuite.hpp trunk/stdair/test/inheritance/Makefile.am trunk/stdair/test/inheritance/inherit.cpp Modified: trunk/stdair/configure.ac =================================================================== --- trunk/stdair/configure.ac 2009-12-23 14:45:19 UTC (rev 67) +++ trunk/stdair/configure.ac 2009-12-28 15:33:39 UTC (rev 68) @@ -204,7 +204,9 @@ test/com/Makefile test/inheritance/Makefile test/mpl/Makefile - test/mpl/book/Makefile) + test/mpl/book/Makefile + test/stdair/Makefile +) AC_OUTPUT echo " Modified: trunk/stdair/test/Makefile.am =================================================================== --- trunk/stdair/test/Makefile.am 2009-12-23 14:45:19 UTC (rev 67) +++ trunk/stdair/test/Makefile.am 2009-12-28 15:33:39 UTC (rev 68) @@ -9,13 +9,7 @@ EXTRA_DIST = ## -check_PROGRAMS = StandardAirlineITTestSuite +check_PROGRAMS = TESTS = $(check_PROGRAMS) -XFAIL_TESTS = #IndexBuildingTestSuite +XFAIL_TESTS = # -StandardAirlineITTestSuite_SOURCES = StandardAirlineITTestSuite.hpp StandardAirlineITTestSuite.cpp -StandardAirlineITTestSuite_CXXFLAGS= $(BOOST_CFLAGS) $(CPPUNIT_CFLAGS) -StandardAirlineITTestSuite_LDADD = -StandardAirlineITTestSuite_LDFLAGS = $(BOOST_LIBS) $(CPPUNIT_LIBS) \ - $(top_builddir)/test/com/libcppunitcore.la \ - $(top_builddir)/@PACKAGE@/core/lib@PACKAGE@.la Deleted: trunk/stdair/test/StandardAirlineITTestSuite.cpp =================================================================== --- trunk/stdair/test/StandardAirlineITTestSuite.cpp 2009-12-23 14:45:19 UTC (rev 67) +++ trunk/stdair/test/StandardAirlineITTestSuite.cpp 2009-12-28 15:33:39 UTC (rev 68) @@ -1,53 +0,0 @@ -// STL -#include <iostream> -#include <string> -// CPPUNIT -#include <test/com/CppUnitCore.hpp> -// STDAIR -//#include <stdair/STDAIR_Service.hpp> -// STDAIR Test Suite -#include <test/StandardAirlineITTestSuite.hpp> - -// ////////////////////////////////////////////////////////////////////// -void testStandardAirlineITHelper() { - - try { - - // Output log File - const std::string lLogFilename ("StandardAirlineITTestSuite.log"); - - // Set the log parameters - std::ofstream logOutputFile; - - // Open and clean the log outputfile - logOutputFile.open (lLogFilename.c_str()); - logOutputFile.clear(); - - // Initialise the stdair BOM - // STDAIR::STDAIR_Service stdairService (logOutputFile); - - } catch (const std::exception& stde) { - std::cerr << "Standard exception: " << stde.what() << std::endl; - - } catch (...) { - std::cerr << "Unknown exception" << std::endl; - } -} - -// ////////////////////////////////////////////////////////////////////// -void StandardAirlineITTestSuite::testStandardAirlineIT() { - CPPUNIT_ASSERT_NO_THROW (testStandardAirlineITHelper();); -} - -// ////////////////////////////////////////////////////////////////////// -// void StandardAirlineITTestSuite::errorCase () { -// CPPUNIT_ASSERT (false); -// } - -// ////////////////////////////////////////////////////////////////////// -StandardAirlineITTestSuite::StandardAirlineITTestSuite () { - _describeKey << "Running test on STDAIR Optimisation function"; -} - -// /////////////// M A I N ///////////////// -CPPUNIT_MAIN() Deleted: trunk/stdair/test/StandardAirlineITTestSuite.hpp =================================================================== --- trunk/stdair/test/StandardAirlineITTestSuite.hpp 2009-12-23 14:45:19 UTC (rev 67) +++ trunk/stdair/test/StandardAirlineITTestSuite.hpp 2009-12-28 15:33:39 UTC (rev 68) @@ -1,25 +0,0 @@ -// STL -#include <sstream> -// CPPUNIT -#include <cppunit/extensions/HelperMacros.h> - -class StandardAirlineITTestSuite : public CppUnit::TestFixture { - CPPUNIT_TEST_SUITE (StandardAirlineITTestSuite); - CPPUNIT_TEST (testStandardAirlineIT); - // CPPUNIT_TEST (errorCase); - CPPUNIT_TEST_SUITE_END (); -public: - - /** Test the Standard Airline IT base library. */ - void testStandardAirlineIT (); - - /** Test some error detection functionalities. */ - // void errorCase (); - - /** Constructor. */ - StandardAirlineITTestSuite (); - -protected: - std::stringstream _describeKey; -}; -CPPUNIT_TEST_SUITE_REGISTRATION (StandardAirlineITTestSuite); Deleted: trunk/stdair/test/inheritance/Makefile.am =================================================================== --- trunk/stdair/test/inheritance/Makefile.am 2009-12-23 14:45:19 UTC (rev 67) +++ trunk/stdair/test/inheritance/Makefile.am 2009-12-28 15:33:39 UTC (rev 68) @@ -1,14 +0,0 @@ -## test/inheritance sub-directory -include $(top_srcdir)/Makefile.common - -MAINTAINERCLEANFILES = Makefile.in - -SUBDIRS = - -check_PROGRAMS = inherit - -inherit_SOURCES = inherit.cpp -inherit_CXXFLAGS = $(BOOST_CFLAGS) -inherit_LDADD = $(BOOST_LIB) - -EXTRA_DIST = Deleted: trunk/stdair/test/inheritance/inherit.cpp =================================================================== --- trunk/stdair/test/inheritance/inherit.cpp 2009-12-23 14:45:19 UTC (rev 67) +++ trunk/stdair/test/inheritance/inherit.cpp 2009-12-28 15:33:39 UTC (rev 68) @@ -1,81 +0,0 @@ -// STL -#include <cassert> -#include <iostream> -#include <string> - -// //////////////////////////////////// -typedef unsigned int Size_T; -typedef std::pair<Size_T, Size_T> RectangleSize_T; - -// //////////////////////////////////// -/** Rectangle */ -struct Rectangle { - - /** Constructor */ - Rectangle (const Size_T& iWidth, const Size_T& iHeight) - : _width (iWidth), _height (iHeight) { } - /** Destructor */ - virtual ~Rectangle () { } - - /** Get the size. */ - RectangleSize_T getSize() const { - return RectangleSize_T (_width, _height); - } - - /** Display. When the object is actually inherits from Rectangle, - the display() method actually called is the one of the - inheriting object. */ - virtual void display () const { - std::cout << "Hello, I am a rectangle of size (" << _width << " x " - << _height << ")" << std::endl; - } - - // //////// Attributes ///////// - /** Width, Height */ - Size_T _width; - Size_T _height; -}; - -/** Square */ -struct Square : public Rectangle { - - /** Constructor */ - Square (const Size_T& iWidth) : Rectangle (iWidth, iWidth) { } - /** Destructor */ - virtual ~Square () { } - - /** Get the size. That method overshadows the Rectangle::getSize() one. */ - Size_T getSize() const { - return _width; - } - - /** Display */ - void display () const { - std::cout << "Hello, I am a square of size (" << _width << ")" - << std::endl; - } -}; - - -// ////////// M A I N ////////////// -int main (int argc, char* argv[]) { - - Square lSquare (10); - lSquare.display(); - const Size_T& lSquareSize = lSquare.getSize(); - std::cout << " and my size is: " << lSquareSize << std::endl; - - Rectangle& lRectangle = lSquare; - lRectangle.display(); - const RectangleSize_T& lRectangleSize = lRectangle.getSize(); - std::cout << " and my size is: " << lRectangleSize.first << " x " - << lRectangleSize.second << std::endl; - - Rectangle lRectangleCopy = lSquare; - lRectangleCopy.display(); - const RectangleSize_T& lRectangleCopySize = lRectangleCopy.getSize(); - std::cout << " and my size is: " << lRectangleCopySize.first << " x " - << lRectangleCopySize.second << std::endl; - - return 0; -} Property changes on: trunk/stdair/test/stdair ___________________________________________________________________ Added: svn:ignore + .deps .libs Makefile.in Makefile StandardAirlineITTestSuite StandardAirlineITTestSuite.log StandardAirlineITTestSuite_results.xml Copied: trunk/stdair/test/stdair/Makefile.am (from rev 67, trunk/stdair/test/Makefile.am) =================================================================== --- trunk/stdair/test/stdair/Makefile.am (rev 0) +++ trunk/stdair/test/stdair/Makefile.am 2009-12-28 15:33:39 UTC (rev 68) @@ -0,0 +1,22 @@ +## test sub-directory +include $(top_srcdir)/Makefile.common + +MAINTAINERCLEANFILES = Makefile.in + +## +SUBDIRS = + +EXTRA_DIST = +## + +check_PROGRAMS = StandardAirlineITTestSuite +TESTS = $(check_PROGRAMS) +XFAIL_TESTS = #IndexBuildingTestSuite + +StandardAirlineITTestSuite_SOURCES = StandardAirlineITTestSuite.hpp \ + StandardAirlineITTestSuite.cpp +StandardAirlineITTestSuite_CXXFLAGS= $(BOOST_CFLAGS) $(CPPUNIT_CFLAGS) +StandardAirlineITTestSuite_LDADD = +StandardAirlineITTestSuite_LDFLAGS = $(BOOST_LIBS) $(CPPUNIT_LIBS) \ + $(top_builddir)/test/com/libcppunitcore.la \ + $(top_builddir)/stdair/core/libstdair.la Copied: trunk/stdair/test/stdair/StandardAirlineITTestSuite.cpp (from rev 67, trunk/stdair/test/StandardAirlineITTestSuite.cpp) =================================================================== --- trunk/stdair/test/stdair/StandardAirlineITTestSuite.cpp (rev 0) +++ trunk/stdair/test/stdair/StandardAirlineITTestSuite.cpp 2009-12-28 15:33:39 UTC (rev 68) @@ -0,0 +1,53 @@ +// STL +#include <iostream> +#include <string> +// CPPUNIT +#include <test/com/CppUnitCore.hpp> +// STDAIR +//#include <stdair/STDAIR_Service.hpp> +// STDAIR Test Suite +#include <test/stdair/StandardAirlineITTestSuite.hpp> + +// ////////////////////////////////////////////////////////////////////// +void testStandardAirlineITHelper() { + + try { + + // Output log File + const std::string lLogFilename ("StandardAirlineITTestSuite.log"); + + // Set the log parameters + std::ofstream logOutputFile; + + // Open and clean the log outputfile + logOutputFile.open (lLogFilename.c_str()); + logOutputFile.clear(); + + // Initialise the stdair BOM + // STDAIR::STDAIR_Service stdairService (logOutputFile); + + } catch (const std::exception& stde) { + std::cerr << "Standard exception: " << stde.what() << std::endl; + + } catch (...) { + std::cerr << "Unknown exception" << std::endl; + } +} + +// ////////////////////////////////////////////////////////////////////// +void StandardAirlineITTestSuite::testStandardAirlineIT() { + CPPUNIT_ASSERT_NO_THROW (testStandardAirlineITHelper();); +} + +// ////////////////////////////////////////////////////////////////////// +// void StandardAirlineITTestSuite::errorCase () { +// CPPUNIT_ASSERT (false); +// } + +// ////////////////////////////////////////////////////////////////////// +StandardAirlineITTestSuite::StandardAirlineITTestSuite () { + _describeKey << "Running test on STDAIR Optimisation function"; +} + +// /////////////// M A I N ///////////////// +CPPUNIT_MAIN() Copied: trunk/stdair/test/stdair/StandardAirlineITTestSuite.hpp (from rev 67, trunk/stdair/test/StandardAirlineITTestSuite.hpp) =================================================================== --- trunk/stdair/test/stdair/StandardAirlineITTestSuite.hpp (rev 0) +++ trunk/stdair/test/stdair/StandardAirlineITTestSuite.hpp 2009-12-28 15:33:39 UTC (rev 68) @@ -0,0 +1,25 @@ +// STL +#include <sstream> +// CPPUNIT +#include <cppunit/extensions/HelperMacros.h> + +class StandardAirlineITTestSuite : public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE (StandardAirlineITTestSuite); + CPPUNIT_TEST (testStandardAirlineIT); + // CPPUNIT_TEST (errorCase); + CPPUNIT_TEST_SUITE_END (); +public: + + /** Test the Standard Airline IT base library. */ + void testStandardAirlineIT (); + + /** Test some error detection functionalities. */ + // void errorCase (); + + /** Constructor. */ + StandardAirlineITTestSuite (); + +protected: + std::stringstream _describeKey; +}; +CPPUNIT_TEST_SUITE_REGISTRATION (StandardAirlineITTestSuite); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |