OSDN Git Service

original
[gb-231r1-is01/Gingerbread_2.3.3_r1_IS01.git] / ndk / tests / device / test-stlport / unit / strstream_buffer_read_test.cpp
1 /*
2  * Note: Strstreams are really broken in STLport. But strstreams are 
3  * obsolete, and even if ones was mentioned in D7.1--D7.4 of 
4  * Standard, we have no wish to spent time with repair ones.
5  */
6 #if !defined (_STLP_NO_IOSTREAMS)
7 #  include <strstream>
8
9 #  include "cppunit/cppunit_proxy.h"
10
11 #  if !defined (STLPORT) || defined(_STLP_USE_NAMESPACES)
12 using namespace std;
13 #  endif
14
15 class StrstreamBufferTest : public CPPUNIT_NS::TestCase
16 {
17   CPPUNIT_TEST_SUITE(StrstreamBufferTest);
18   CPPUNIT_TEST(read_from_buffer);
19   CPPUNIT_TEST_SUITE_END();
20
21 protected:
22   void read_from_buffer();
23 };
24
25 CPPUNIT_TEST_SUITE_REGISTRATION(StrstreamBufferTest);
26
27 void StrstreamBufferTest::read_from_buffer()
28 {
29   char hello[] = "Hello";
30   strstream stream(hello, sizeof(hello), ios_base::in);
31   char cur;
32   stream >> cur;
33   CPPUNIT_ASSERT(cur == 'H'); 
34 }
35 #endif