ReactOS 0.4.15-dev-7998-gdb93cb1
ostmit_test.cpp
Go to the documentation of this file.
1#include <iterator>
2#if !defined (STLPORT) || !defined (_STLP_USE_NO_IOSTREAMS)
3#include <string>
4#include <sstream>
5#include <algorithm>
6
8
9#if !defined (STLPORT) || defined(_STLP_USE_NAMESPACES)
10using namespace std;
11#endif
12
13//
14// TestCase class
15//
16class OstreamIteratorTest : public CPPUNIT_NS::TestCase
17{
21
22protected:
23 void ostmit0();
24};
25
27
28//
29// tests implementation
30//
32{
33 // not necessary, tested in copy_test
34 int array [] = { 1, 5, 2, 4 };
35
36 const char* text = "hello";
37
39
41 copy(text, text + 5, iter);
42 CPPUNIT_ASSERT(os.good());
43 os << ' ';
44 CPPUNIT_ASSERT(os.good());
45
46 ostream_iterator<int> iter2(os);
47 copy(array, array + 4, iter2);
48 CPPUNIT_ASSERT(os.good());
49 CPPUNIT_ASSERT(os.str() == "hello 1524");
50}
51
52#endif
basic_ostringstream< char, char_traits< char >, allocator< char > > ostringstream
Definition: _iosfwd.h:127
INT copy(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], INT append, DWORD lpdwFlags, BOOL bTouch)
Definition: copy.c:51
CPPUNIT_TEST_SUITE(OstreamIteratorTest)
#define CPPUNIT_TEST_SUITE_REGISTRATION(X)
Definition: cppunit_mini.h:193
#define CPPUNIT_ASSERT(X)
Definition: cppunit_mini.h:200
const WCHAR * text
Definition: package.c:1799
Definition: features.h:417