// 1999-07-28 bkoz
-// Copyright (C) 1999, 2001 Free Software Foundation
+// Copyright (C) 1999, 2001, 2003 Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
#include <fstream>
#include <testsuite_hooks.h>
-
// stringbufs.
-bool test01() {
-
+void test01()
+{
typedef std::ios::traits_type ctraits_type;
bool test = true;
VERIFY( strtmp == str_02 ); // as only an "in" buffer
VERIFY( isbuf_03.sgetc() == 'a' );
VERIFY( is_04.peek() == ctraits_type::eof() );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
-
- return test;
-}
-
-// filebufs.
-bool test02() {
-
- bool test = true;
- typedef std::ios::traits_type ctraits_type;
- const char name_01[] = "istream_extractor_other-1.txt"; //read
- const char name_02[] = "istream_extractor_other-2.txt"; //write
-
- std::filebuf fbin, fbout;
- fbin.open(name_01, std::ios_base::in);
- fbout.open(name_02, std::ios_base::out | std::ios_base::trunc);
- VERIFY( fbin.is_open() );
- VERIFY( fbout.is_open() );
-
- if (test)
- {
- std::istream is(&fbin);
- is.unsetf(std::ios_base::skipws);
- is >> &fbout;
- }
-
- fbout.close();
- fbin.close();
- VERIFY( !fbin.is_open() );
- VERIFY( !fbout.is_open() );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
-
- return test;
-}
-
-void test03()
-{
- using namespace std;
- bool test = true;
-
- // template<_CharT, _Traits>
- // basic_istream& operator>>(ios_base& (*pf) (ios_base&))
- {
- int i = 0;
- std::istringstream iss(" 43");
- iss >> std::noskipws >> i;
- std::ios::iostate i3 = iss.rdstate();
- VERIFY ( !iss ); //should set failbit
- }
-
- // template<_CharT, _Traits>
- // basic_istream& operator>>(basic_ios& (*pf) (basic_ios&))
-
- // template<_CharT, _Traits>
- // basic_istream& operator>>(basic_istream& (*pf) (basic_istream&))
}
-
int main()
{
test01();
- test02();
- test03();
return 0;
}