diff options
author | Dan Albert <danalbert@google.com> | 2015-05-13 22:19:19 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-05-13 22:19:19 +0000 |
commit | 66a8b10f0d9836bb33ea0a1c32962619c7a9ee32 (patch) | |
tree | 229c42240cb4c08d0e7d2799de08bf4628d07e22 /test/unit/iostream_test.cpp | |
parent | f93b0c8350e72556faa137400cc955440654d29e (diff) | |
parent | daa71cf2aac6723fce66224c41873bb430ff61dc (diff) | |
download | stlport-66a8b10f0d9836bb33ea0a1c32962619c7a9ee32.tar.gz |
Merge "Replace stlport source with prebuilts."HEADandroid-m-preview-2android-m-preview-1android-m-previewmastermain
Diffstat (limited to 'test/unit/iostream_test.cpp')
-rw-r--r-- | test/unit/iostream_test.cpp | 116 |
1 files changed, 0 insertions, 116 deletions
diff --git a/test/unit/iostream_test.cpp b/test/unit/iostream_test.cpp deleted file mode 100644 index a4db5d8..0000000 --- a/test/unit/iostream_test.cpp +++ /dev/null @@ -1,116 +0,0 @@ -#include <string> - -#if !defined (STLPORT) || !defined (_STLP_USE_NO_IOSTREAMS) -# include <sstream> -//# include <locale> -# include <iostream> -//# include <stdexcept> - -# include "cppunit/cppunit_proxy.h" - -# if !defined (STLPORT) || defined(_STLP_USE_NAMESPACES) -using namespace std; -# endif - -// -// TestCase class -// -class IOStreamTest : public CPPUNIT_NS::TestCase -{ - CPPUNIT_TEST_SUITE(IOStreamTest); - CPPUNIT_TEST(manipulators); - CPPUNIT_TEST(in_avail); -//#if defined (STLPORT) && defined (_STLP_NO_WCHAR_T) - //CPPUNIT_IGNORE; -//#endif - //CPPUNIT_TEST(wimbue); - CPPUNIT_TEST_SUITE_END(); - -private: - void manipulators(); - void in_avail(); - //void wimbue(); -}; - -CPPUNIT_TEST_SUITE_REGISTRATION(IOStreamTest); - -// -// tests implementation -// -void IOStreamTest::manipulators() -{ - { - istringstream istr; - istr.str("bar"); - - istr >> ws; - CPPUNIT_ASSERT( istr.good() ); - - string foo; - istr >> foo; - CPPUNIT_ASSERT( istr.eof() ); - CPPUNIT_ASSERT( !istr.fail() ); - CPPUNIT_ASSERT( foo == "bar" ); - - istr >> ws; - CPPUNIT_ASSERT( istr.eof() ); - CPPUNIT_ASSERT( !istr.fail() ); - istr.clear(); - } - - { - istringstream istr; - istr.str(" bar "); - - istr >> ws; - CPPUNIT_ASSERT( istr.good() ); - - string foo; - istr >> foo; - CPPUNIT_ASSERT( !istr.eof() ); - CPPUNIT_ASSERT( !istr.fail() ); - CPPUNIT_ASSERT( foo == "bar" ); - - istr >> ws; - CPPUNIT_ASSERT( istr.eof() ); - CPPUNIT_ASSERT( !istr.fail() ); - istr.clear(); - } -} - - -void IOStreamTest::in_avail() -{ - CPPUNIT_CHECK( cin.rdbuf()->in_avail() == 0 ); - CPPUNIT_CHECK( cout.rdbuf()->in_avail() == -1 ); - CPPUNIT_CHECK( clog.rdbuf()->in_avail() == -1 ); - CPPUNIT_CHECK( cerr.rdbuf()->in_avail() == -1 ); - -#if !defined (STLPORT) || !defined (_STLP_NO_WCHAR_T) - CPPUNIT_CHECK( wcin.rdbuf()->in_avail() == 0 ); - CPPUNIT_CHECK( wcout.rdbuf()->in_avail() == 0 ); - CPPUNIT_CHECK( wclog.rdbuf()->in_avail() == 0 ); - CPPUNIT_CHECK( wcerr.rdbuf()->in_avail() == 0 ); -#endif -} - -//void IOStreamTest::wimbue() -//{ -//#if !defined (STLPORT) || !defined (_STLP_NO_WCHAR_T) -// locale loc; -// try { -// locale tmp(".866"); -// loc = tmp; -// } -// catch (const runtime_error&) { -// return; -// } -// -// wcout.imbue(loc); -// wcout << L"Hello world" << endl; -// wcout.imbue(loc); -// wcout << L"Hello world" << endl; -//#endif -//} - -#endif |