strstream_test.cpp revision e46c9386c4f79aa40185f79a19fc5b2a7ef528b3
1#include <string>
2
3#if !defined (STLPORT) || !defined (_STLP_USE_NO_IOSTREAMS)
4#  include <strstream>
5#  include <limits>
6
7#  include "cppunit/cppunit_proxy.h"
8
9#  if !defined (STLPORT) || defined(_STLP_USE_NAMESPACES)
10using namespace std;
11#  endif
12
13//
14// TestCase class
15//
16class StrstreamTest : public CPPUNIT_NS::TestCase
17{
18  CPPUNIT_TEST_SUITE(StrstreamTest);
19  CPPUNIT_TEST(input);
20  CPPUNIT_TEST_SUITE_END();
21
22private:
23  void input();
24};
25
26CPPUNIT_TEST_SUITE_REGISTRATION(StrstreamTest);
27
28//
29// tests implementation
30//
31void StrstreamTest::input()
32{
33#  if defined (STLPORT) && defined (_STLP_LONG_LONG)
34  {
35    istrstream is("652208307");
36    _STLP_LONG_LONG rval = 0;
37    is >> rval;
38    CPPUNIT_ASSERT( rval == 652208307 );
39  }
40  {
41    istrstream is("-652208307");
42    _STLP_LONG_LONG rval = 0;
43    is >> rval;
44    CPPUNIT_ASSERT( rval == -652208307 );
45  }
46}
47#  endif
48
49#endif
50