5 #include "cppunit/cppunit_proxy.h"
7 #if !defined (STLPORT) || defined(_STLP_USE_NAMESPACES)
14 class FinsertTest
: public CPPUNIT_NS::TestCase
16 CPPUNIT_TEST_SUITE(FinsertTest
);
17 CPPUNIT_TEST(finsert1
);
18 CPPUNIT_TEST(finsert2
);
19 CPPUNIT_TEST_SUITE_END();
26 CPPUNIT_TEST_SUITE_REGISTRATION(FinsertTest
);
29 // tests implementation
31 void FinsertTest::finsert1()
33 char const* array
[] = { "laurie", "jennifer", "leisa" };
34 deque
<char const*> names
;
35 front_insert_iterator
<deque
<char const*> > fit(names
);
36 fit
= copy(array
, array
+ 3, front_insert_iterator
<deque
<char const*> >(names
));
38 CPPUNIT_ASSERT(names
[0]==array
[2]);
39 CPPUNIT_ASSERT(names
[1]==array
[1]);
40 CPPUNIT_ASSERT(names
[2]==array
[0]);
42 copy(array
, array
+ 3, fit
);
43 CPPUNIT_ASSERT(names
[3]==array
[2]);
44 CPPUNIT_ASSERT(names
[4]==array
[1]);
45 CPPUNIT_ASSERT(names
[5]==array
[0]);
48 void FinsertTest::finsert2()
50 char const* array
[] = { "laurie", "jennifer", "leisa" };
52 deque
<char const*> names
;
53 copy(array
, array
+ 3, front_inserter(names
));
55 CPPUNIT_ASSERT(names
[0]==array
[2]);
56 CPPUNIT_ASSERT(names
[1]==array
[1]);
57 CPPUNIT_ASSERT(names
[2]==array
[0]);