]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libstdc++-v3/testsuite/24_iterators/istreambuf_iterator/2.cc
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / 24_iterators / istreambuf_iterator / 2.cc
index 83ed6566b30e74866375cebf6ce269880c9a8058..46f67573cc756c1d1dfbb8ead66a61bd622e29ab 100644 (file)
@@ -1,6 +1,6 @@
 // 1999-06-28 bkoz
 
-// Copyright (C) 1999-2016 Free Software Foundation, Inc.
+// Copyright (C) 1999-2024 Free Software Foundation, Inc.
 //
 // 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 <iterator>
 #include <testsuite_hooks.h>
 
-bool test02(void)
+void test02(void)
 {
-
   typedef std::istreambuf_iterator<char> cistreambuf_iter;
-  typedef cistreambuf_iter::streambuf_type cstreambuf_type;
-  bool test __attribute__((unused)) = true;
   const char slit01[] = "playa hermosa, liberia, guanacaste";
   std::string str01(slit01);
   std::istringstream istrs00(str01);
@@ -36,10 +33,14 @@ bool test02(void)
 
   // ctor sanity checks
   cistreambuf_iter istrb_it01(istrs00);
-  cistreambuf_iter istrb_it02;
-  std::string tmp(istrb_it01, istrb_it02); 
+  cistreambuf_iter istrb_eos;
+  VERIFY( istrb_it01 != istrb_eos );
+
+  std::string tmp(istrb_it01, istrb_eos);
   VERIFY( tmp == str01 );
 
+  VERIFY( istrb_it01 == istrb_eos );
+
   cistreambuf_iter istrb_it03(0);
   cistreambuf_iter istrb_it04;
   VERIFY( istrb_it03 == istrb_it04 );
@@ -106,7 +107,6 @@ bool test02(void)
       c = *++istrb_it28;
       VERIFY( c == slit01[++i] );
     }
-  return test;
 }
 
 int main()