25 #ifndef WMIXINVECTOR_TEST_H
26 #define WMIXINVECTOR_TEST_H
31 #include <cxxtest/TestSuite.h>
33 #include "../WMixinVector.h"
34 #include "WMixinVectorTraits.h"
39 class A {
public: A(){m_x = 3.1415;}
bool operator==(
double x){
return m_x == x;}
double m_x; };
64 TS_ASSERT( stringV.
size() == 2 );
65 TS_ASSERT_EQUALS( stringV[0],
"bla" );
66 TS_ASSERT_EQUALS( stringV[1],
"bla" );
68 TS_ASSERT_EQUALS( aV.
size(), 5 );
69 for(
size_t i = 0; i < 5; ++i )
71 TS_ASSERT_EQUALS( aV[i], 3.1415 );
82 TS_ASSERT_EQUALS( intV, intV2 );
84 TS_ASSERT_DIFFERS( intV, intV2 );
92 std::vector< char > charV( 5,
's' );
94 TS_ASSERT_EQUALS( charV, charV2 );
96 TS_ASSERT_DIFFERS( charV, charV2 );
104 int myints[] = { 16, 2, 77, 29 };
106 TS_ASSERT_EQUALS( v.
size(), 4 );
107 TS_ASSERT_EQUALS( v[0], 16 );
108 TS_ASSERT_EQUALS( v[1], 2 );
109 TS_ASSERT_EQUALS( v[2], 77 );
110 TS_ASSERT_EQUALS( v[3], 29 );
Unit tests the WMixinVector copy from OSG.
void testCopyCtorOnRealSTDVector(void)
If you have a std::vector< T > copy construction should still be possible.
void testCopyCtorOnWMixinVector(void)
If you have another WMixinVector a copy construction should be possible.
void testDefaultCtor(void)
Test the default Ctor.
void testIteratorConstructor(void)
A creation should also be possible out of iterators.
void testSizeValueCtor(void)
You may initialize a vector with a given size and optionally with a default value of the elments.
This is taken from OpenSceneGraph <osg/MixinVector> but copy and pasted in order to reduce dependency...
size_type size() const
Wrapper around std::vector member function.