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)
12using namespace std;
13#  endif
14
15class StrstreamBufferTest : public CPPUNIT_NS::TestCase
16{
17  CPPUNIT_TEST_SUITE(StrstreamBufferTest);
18  CPPUNIT_TEST(read_from_buffer);
19  CPPUNIT_TEST_SUITE_END();
20
21protected:
22  void read_from_buffer();
23};
24
25CPPUNIT_TEST_SUITE_REGISTRATION(StrstreamBufferTest);
26
27void 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
36