From d63b60f59b2c036a17d54652f02c783767bbd4c2 Mon Sep 17 00:00:00 2001 From: Jan Travnicek <Jan.Travnicek@fit.cvut.cz> Date: Tue, 20 Dec 2016 08:38:22 +0100 Subject: [PATCH] test nothrow_move_constructible wrapper classes --- alib2common/test-src/object/ObjectTest.cpp | 29 ++++++++++++++++++++++ alib2common/test-src/object/ObjectTest.h | 18 ++++++++++++++ alib2data/test-src/label/LabelTest.cpp | 4 +++ alib2data/test-src/label/LabelTest.h | 2 ++ 4 files changed, 53 insertions(+) create mode 100644 alib2common/test-src/object/ObjectTest.cpp create mode 100644 alib2common/test-src/object/ObjectTest.h diff --git a/alib2common/test-src/object/ObjectTest.cpp b/alib2common/test-src/object/ObjectTest.cpp new file mode 100644 index 0000000000..4f08f9e2db --- /dev/null +++ b/alib2common/test-src/object/ObjectTest.cpp @@ -0,0 +1,29 @@ +#include <list> +#include "ObjectTest.h" + +#include "sax/SaxParseInterface.h" +#include "sax/SaxComposeInterface.h" + +#include "object/Object.h" +#include "container/ObjectsPair.h" +#include <primitive/Character.h> + +#include "factory/XmlDataFactory.hpp" + +#include <type_traits> + +#define CPPUNIT_IMPLY( x, y ) CPPUNIT_ASSERT ( !( x ) || ( y ) ) +#define CPPUNIT_EXCLUSIVE_OR( x, y ) CPPUNIT_ASSERT ( ( !( x ) && ( y ) ) || ( ( x ) && !( y ) ) ) + +CPPUNIT_TEST_SUITE_NAMED_REGISTRATION ( ObjectTest, "object" ); +CPPUNIT_TEST_SUITE_REGISTRATION ( ObjectTest ); + +void ObjectTest::setUp ( ) { +} + +void ObjectTest::tearDown ( ) { +} + +void ObjectTest::testProperties ( ) { + CPPUNIT_ASSERT ( std::is_nothrow_move_constructible < alib::Object >::value ); +} diff --git a/alib2common/test-src/object/ObjectTest.h b/alib2common/test-src/object/ObjectTest.h new file mode 100644 index 0000000000..33a4686020 --- /dev/null +++ b/alib2common/test-src/object/ObjectTest.h @@ -0,0 +1,18 @@ +#ifndef OBJECT_TEST_H_ +#define OBJECT_TEST_H_ + +#include <cppunit/extensions/HelperMacros.h> + +class ObjectTest : public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE ( ObjectTest ); + CPPUNIT_TEST ( testProperties ); + CPPUNIT_TEST_SUITE_END ( ); + +public: + void setUp ( ); + void tearDown ( ); + + void testProperties ( ); +}; + +#endif // OBJECT_TEST_H_ diff --git a/alib2data/test-src/label/LabelTest.cpp b/alib2data/test-src/label/LabelTest.cpp index 1d32b7eab4..c3bbc603fa 100644 --- a/alib2data/test-src/label/LabelTest.cpp +++ b/alib2data/test-src/label/LabelTest.cpp @@ -13,6 +13,7 @@ #include "factory/XmlDataFactory.hpp" #include <algorithm> +#include <type_traits> #define CPPUNIT_EXCLUSIVE_OR(x, y) CPPUNIT_ASSERT((!(x) && (y)) || ((x) && !(y))) @@ -99,3 +100,6 @@ void LabelTest::testInSet() { } } +void LabelTest::testProperties ( ) { + CPPUNIT_ASSERT ( std::is_nothrow_move_constructible < label::Label >::value ); +} diff --git a/alib2data/test-src/label/LabelTest.h b/alib2data/test-src/label/LabelTest.h index 1f8927565f..97eb2b2398 100644 --- a/alib2data/test-src/label/LabelTest.h +++ b/alib2data/test-src/label/LabelTest.h @@ -10,6 +10,7 @@ class LabelTest : public CppUnit::TestFixture CPPUNIT_TEST( testXMLParser ); CPPUNIT_TEST( testOrder ); CPPUNIT_TEST( testInSet ); + CPPUNIT_TEST( testProperties ); CPPUNIT_TEST_SUITE_END(); public: @@ -20,6 +21,7 @@ public: void testXMLParser(); void testOrder(); void testInSet(); + void testProperties(); }; #endif // LABEL_TEST_H_ -- GitLab