From 4c6af80d522f7664fd3887ab6684fa60a4ee7276 Mon Sep 17 00:00:00 2001 From: Jan Travnicek <Jan.Travnicek@fit.cvut.cz> Date: Tue, 24 Apr 2018 15:39:51 +0200 Subject: [PATCH] test rvalue_ref --- alib2std/test-src/extensions/UtilityTest.cpp | 24 ++++++++++++++++++++ alib2std/test-src/extensions/UtilityTest.h | 19 ++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 alib2std/test-src/extensions/UtilityTest.cpp create mode 100644 alib2std/test-src/extensions/UtilityTest.h diff --git a/alib2std/test-src/extensions/UtilityTest.cpp b/alib2std/test-src/extensions/UtilityTest.cpp new file mode 100644 index 0000000000..7dd7748ed8 --- /dev/null +++ b/alib2std/test-src/extensions/UtilityTest.cpp @@ -0,0 +1,24 @@ +#include "UtilityTest.h" +#include <alib/utility> + +CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( UtilityTest, "bits" ); +CPPUNIT_TEST_SUITE_REGISTRATION( UtilityTest ); + +void UtilityTest::setUp() { +} + +void UtilityTest::tearDown() { +} + +class Foo { +public: + int bar ( ) { + return 1; + } +}; + +void UtilityTest::testProperties() { + ext::rvalue_ref < Foo > val ( new Foo ); + CPPUNIT_ASSERT ( val->bar ( ) == 1 ); +} + diff --git a/alib2std/test-src/extensions/UtilityTest.h b/alib2std/test-src/extensions/UtilityTest.h new file mode 100644 index 0000000000..a04660a513 --- /dev/null +++ b/alib2std/test-src/extensions/UtilityTest.h @@ -0,0 +1,19 @@ +#ifndef UTILITY_TEST_H_ +#define UTILITY_TEST_H_ + +#include <cppunit/extensions/HelperMacros.h> + +class UtilityTest : public CppUnit::TestFixture +{ + CPPUNIT_TEST_SUITE( UtilityTest ); + CPPUNIT_TEST( testProperties ); + CPPUNIT_TEST_SUITE_END(); + +public: + void setUp(); + void tearDown(); + + void testProperties(); +}; + +#endif // UTILITY_TEST_H_ -- GitLab