ReactOS
0.4.16-dev-306-g647d351
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
7
#include "
cppunit/cppunit_proxy.h
"
8
9
#if !defined (STLPORT) || defined(_STLP_USE_NAMESPACES)
10
using namespace
std
;
11
#endif
12
13
//
14
// TestCase class
15
//
16
class
OstreamIteratorTest
:
public
CPPUNIT_NS::TestCase
17
{
18
CPPUNIT_TEST_SUITE
(
OstreamIteratorTest
);
19
CPPUNIT_TEST
(
ostmit0
);
20
CPPUNIT_TEST_SUITE_END
();
21
22
protected
:
23
void
ostmit0
();
24
};
25
26
CPPUNIT_TEST_SUITE_REGISTRATION
(
OstreamIteratorTest
);
27
28
//
29
// tests implementation
30
//
31
void
OstreamIteratorTest::ostmit0
()
32
{
33
// not necessary, tested in copy_test
34
int
array
[] = { 1, 5, 2, 4 };
35
36
const
char
*
text
=
"hello"
;
37
38
ostringstream
os;
39
40
ostream_iterator<char>
iter(os);
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
ostringstream
basic_ostringstream< char, char_traits< char >, allocator< char > > ostringstream
Definition:
_iosfwd.h:127
copy
INT copy(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], INT append, DWORD lpdwFlags, BOOL bTouch)
Definition:
copy.c:51
OstreamIteratorTest
Definition:
ostmit_test.cpp:17
OstreamIteratorTest::CPPUNIT_TEST
CPPUNIT_TEST(ostmit0)
OstreamIteratorTest::ostmit0
void ostmit0()
Definition:
ostmit_test.cpp:31
OstreamIteratorTest::CPPUNIT_TEST_SUITE_END
CPPUNIT_TEST_SUITE_END()
OstreamIteratorTest::CPPUNIT_TEST_SUITE
CPPUNIT_TEST_SUITE(OstreamIteratorTest)
ostream_iterator
Definition:
_stream_iterator.h:162
CPPUNIT_TEST_SUITE_REGISTRATION
#define CPPUNIT_TEST_SUITE_REGISTRATION(X)
Definition:
cppunit_mini.h:193
CPPUNIT_ASSERT
#define CPPUNIT_ASSERT(X)
Definition:
cppunit_mini.h:200
cppunit_proxy.h
text
const WCHAR * text
Definition:
package.c:1794
std
Definition:
features.h:417
array
Definition:
wbemprox_private.h:130
sdk
lib
3rdparty
stlport
test
unit
ostmit_test.cpp
Generated on Mon Dec 2 2024 06:15:33 for ReactOS by
1.9.6