* testsuite/testsuite_hooks.h: Remove list include.
(func_callback): Define as unique type, not std::list.
Change DEBUG_ASSERT to _GLIBCXX_ASSERT.
* testsuite/libstdc++-v3.dg/dg.exp: Same.
* testsuite/lib/libstdc++-v3-dg.exp (libstdc++-v3-init): Same.
* testsuite/23_containers/bitset_ctor.cc:
* testsuite/17_intro/header_ciso646.cc: Remove DEBUG_ASSERT.
* testsuite/18_support/numeric_limits.cc: Same.
* testsuite/21_strings/basic_string/append/char/1.cc: Same.
* testsuite/21_strings/basic_string/append/wchar_t/1.cc: Same.
* testsuite/21_strings/basic_string/compare/char/1.cc: Same.
* testsuite/21_strings/basic_string/compare/wchar_t/1.cc: Same.
* testsuite/21_strings/basic_string/element_access/char/1.cc: Same.
* testsuite/21_strings/basic_string/element_access/char/2.cc: Same.
* testsuite/21_strings/basic_string/element_access/char/3.cc: Same.
* testsuite/21_strings/basic_string/element_access/wchar_t/1.cc: Same.
* testsuite/21_strings/basic_string/element_access/wchar_t/2.cc: Same.
* testsuite/21_strings/basic_string/element_access/wchar_t/3.cc: Same.
* testsuite/21_strings/basic_string/find/char/1.cc: Same.
* testsuite/21_strings/basic_string/find/char/2.cc: Same.
* testsuite/21_strings/basic_string/find/char/3.cc: Same.
* testsuite/21_strings/basic_string/find/wchar_t/1.cc: Same.
* testsuite/21_strings/basic_string/find/wchar_t/2.cc: Same.
* testsuite/21_strings/basic_string/find/wchar_t/3.cc: Same.
* testsuite/21_strings/basic_string/insert/char/1.cc: Same.
* testsuite/21_strings/basic_string/insert/char/2.cc: Same.
* testsuite/21_strings/basic_string/insert/wchar_t/1.cc: Same.
* testsuite/21_strings/basic_string/insert/wchar_t/2.cc: Same.
* testsuite/21_strings/basic_string/inserters_extractors/char/1.cc:
* testsuite/21_strings/basic_string/inserters_extractors/char/4.cc:
* testsuite/21_strings/basic_string/inserters_extractors/char/5.cc:
* testsuite/21_strings/basic_string/inserters_extractors/char/6.cc:
* testsuite/21_strings/basic_string/inserters_extractors/char/7.cc:
* testsuite/21_strings/basic_string/inserters_extractors/wchar_t/1.cc:
* testsuite/21_strings/basic_string/inserters_extractors/wchar_t/4.cc:
* testsuite/21_strings/basic_string/inserters_extractors/wchar_t/5.cc:
* testsuite/21_strings/basic_string/inserters_extractors/wchar_t/6.cc:
* testsuite/21_strings/basic_string/inserters_extractors/wchar_t/7.cc:
* testsuite/21_strings/basic_string/operators/char/1.cc: Same.
* testsuite/21_strings/basic_string/operators/char/2.cc: Same.
* testsuite/21_strings/basic_string/operators/wchar_t/1.cc: Same.
* testsuite/21_strings/basic_string/operators/wchar_t/2.cc: Same.
* testsuite/21_strings/basic_string/replace/char/1.cc: Same.
* testsuite/21_strings/basic_string/replace/wchar_t/1.cc: Same.
* testsuite/21_strings/basic_string/rfind/char/1.cc: Same.
* testsuite/21_strings/basic_string/rfind/char/2.cc: Same.
* testsuite/21_strings/basic_string/rfind/char/3.cc: Same.
* testsuite/21_strings/basic_string/rfind/wchar_t/1.cc: Same.
* testsuite/21_strings/basic_string/rfind/wchar_t/2.cc: Same.
* testsuite/21_strings/basic_string/rfind/wchar_t/3.cc: Same.
* testsuite/21_strings/basic_string/substr/char/1.cc: Same.
* testsuite/21_strings/basic_string/substr/wchar_t/1.cc: Same.
* testsuite/23_containers/bitset_ctor.cc: Same.
* testsuite/23_containers/bitset_shift.cc: Same.
* testsuite/23_containers/vector_ctor.cc: Same.
* testsuite/23_containers/vector_element_access.cc: Same.
* testsuite/24_iterators/istreambuf_iterator.cc: Same.
* testsuite/24_iterators/iterator.cc: Same.
* testsuite/24_iterators/ostreambuf_iterator.cc: Same.
* testsuite/25_algorithms/lower_bound.cc: Same.
* testsuite/26_numerics/complex_inserters_extractors.cc: Same.
* testsuite/27_io/basic_istream/extractors_arithmetic/char/01.cc: Same.
* testsuite/27_io/basic_istream/extractors_arithmetic/char/02.cc: Same.
* testsuite/27_io/basic_istream/extractors_arithmetic/char/03.cc: Same.
* testsuite/27_io/basic_istream/extractors_arithmetic/char/06.cc: Same.
* testsuite/27_io/basic_istream/extractors_arithmetic/char/07.cc: Same.
* testsuite/27_io/basic_istream/extractors_arithmetic/char/08.cc: Same.
* testsuite/27_io/basic_istream/extractors_arithmetic/char/09.cc: Same.
* testsuite/27_io/basic_istream/extractors_arithmetic/char/10.cc: Same.
* testsuite/27_io/basic_ostream/inserters_arithmetic/char/1.cc: Same.
* testsuite/27_io/basic_ostream/inserters_arithmetic/wchar_t/1.cc:
Same.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@69892
138bc75d-0d04-0410-961f-
82ee72b054a4
+2003-07-28 Benjamin Kosnik <bkoz@redhat.com>
+
+ * testsuite/testsuite_hooks.h: Remove list include.
+ (func_callback): Define as unique type, not std::list.
+ Change DEBUG_ASSERT to _GLIBCXX_ASSERT.
+ * testsuite/libstdc++-v3.dg/dg.exp: Same.
+ * testsuite/lib/libstdc++-v3-dg.exp (libstdc++-v3-init): Same.
+ * testsuite/23_containers/bitset_ctor.cc:
+ * testsuite/17_intro/header_ciso646.cc: Remove DEBUG_ASSERT.
+ * testsuite/18_support/numeric_limits.cc: Same.
+ * testsuite/21_strings/basic_string/append/char/1.cc: Same.
+ * testsuite/21_strings/basic_string/append/wchar_t/1.cc: Same.
+ * testsuite/21_strings/basic_string/compare/char/1.cc: Same.
+ * testsuite/21_strings/basic_string/compare/wchar_t/1.cc: Same.
+ * testsuite/21_strings/basic_string/element_access/char/1.cc: Same.
+ * testsuite/21_strings/basic_string/element_access/char/2.cc: Same.
+ * testsuite/21_strings/basic_string/element_access/char/3.cc: Same.
+ * testsuite/21_strings/basic_string/element_access/wchar_t/1.cc: Same.
+ * testsuite/21_strings/basic_string/element_access/wchar_t/2.cc: Same.
+ * testsuite/21_strings/basic_string/element_access/wchar_t/3.cc: Same.
+ * testsuite/21_strings/basic_string/find/char/1.cc: Same.
+ * testsuite/21_strings/basic_string/find/char/2.cc: Same.
+ * testsuite/21_strings/basic_string/find/char/3.cc: Same.
+ * testsuite/21_strings/basic_string/find/wchar_t/1.cc: Same.
+ * testsuite/21_strings/basic_string/find/wchar_t/2.cc: Same.
+ * testsuite/21_strings/basic_string/find/wchar_t/3.cc: Same.
+ * testsuite/21_strings/basic_string/insert/char/1.cc: Same.
+ * testsuite/21_strings/basic_string/insert/char/2.cc: Same.
+ * testsuite/21_strings/basic_string/insert/wchar_t/1.cc: Same.
+ * testsuite/21_strings/basic_string/insert/wchar_t/2.cc: Same.
+ * testsuite/21_strings/basic_string/inserters_extractors/char/1.cc:
+ * testsuite/21_strings/basic_string/inserters_extractors/char/4.cc:
+ * testsuite/21_strings/basic_string/inserters_extractors/char/5.cc:
+ * testsuite/21_strings/basic_string/inserters_extractors/char/6.cc:
+ * testsuite/21_strings/basic_string/inserters_extractors/char/7.cc:
+ * testsuite/21_strings/basic_string/inserters_extractors/wchar_t/1.cc:
+ * testsuite/21_strings/basic_string/inserters_extractors/wchar_t/4.cc:
+ * testsuite/21_strings/basic_string/inserters_extractors/wchar_t/5.cc:
+ * testsuite/21_strings/basic_string/inserters_extractors/wchar_t/6.cc:
+ * testsuite/21_strings/basic_string/inserters_extractors/wchar_t/7.cc:
+ * testsuite/21_strings/basic_string/operators/char/1.cc: Same.
+ * testsuite/21_strings/basic_string/operators/char/2.cc: Same.
+ * testsuite/21_strings/basic_string/operators/wchar_t/1.cc: Same.
+ * testsuite/21_strings/basic_string/operators/wchar_t/2.cc: Same.
+ * testsuite/21_strings/basic_string/replace/char/1.cc: Same.
+ * testsuite/21_strings/basic_string/replace/wchar_t/1.cc: Same.
+ * testsuite/21_strings/basic_string/rfind/char/1.cc: Same.
+ * testsuite/21_strings/basic_string/rfind/char/2.cc: Same.
+ * testsuite/21_strings/basic_string/rfind/char/3.cc: Same.
+ * testsuite/21_strings/basic_string/rfind/wchar_t/1.cc: Same.
+ * testsuite/21_strings/basic_string/rfind/wchar_t/2.cc: Same.
+ * testsuite/21_strings/basic_string/rfind/wchar_t/3.cc: Same.
+ * testsuite/21_strings/basic_string/substr/char/1.cc: Same.
+ * testsuite/21_strings/basic_string/substr/wchar_t/1.cc: Same.
+ * testsuite/23_containers/bitset_ctor.cc: Same.
+ * testsuite/23_containers/bitset_shift.cc: Same.
+ * testsuite/23_containers/vector_ctor.cc: Same.
+ * testsuite/23_containers/vector_element_access.cc: Same.
+ * testsuite/24_iterators/istreambuf_iterator.cc: Same.
+ * testsuite/24_iterators/iterator.cc: Same.
+ * testsuite/24_iterators/ostreambuf_iterator.cc: Same.
+ * testsuite/25_algorithms/lower_bound.cc: Same.
+ * testsuite/26_numerics/complex_inserters_extractors.cc: Same.
+ * testsuite/27_io/basic_istream/extractors_arithmetic/char/01.cc: Same.
+ * testsuite/27_io/basic_istream/extractors_arithmetic/char/02.cc: Same.
+ * testsuite/27_io/basic_istream/extractors_arithmetic/char/03.cc: Same.
+ * testsuite/27_io/basic_istream/extractors_arithmetic/char/06.cc: Same.
+ * testsuite/27_io/basic_istream/extractors_arithmetic/char/07.cc: Same.
+ * testsuite/27_io/basic_istream/extractors_arithmetic/char/08.cc: Same.
+ * testsuite/27_io/basic_istream/extractors_arithmetic/char/09.cc: Same.
+ * testsuite/27_io/basic_istream/extractors_arithmetic/char/10.cc: Same.
+ * testsuite/27_io/basic_ostream/inserters_arithmetic/char/1.cc: Same.
+ * testsuite/27_io/basic_ostream/inserters_arithmetic/wchar_t/1.cc:
+ Same.
+
2003-07-28 Phil Edwards <pme@gcc.gnu.org>
* docs/doxygen/user.cfg.in, docs/html/abi.txt, docs/html/debug.html,
// 1999-05-20 bkoz
-// Copyright (C) 1999 Free Software Foundation, Inc.
+// Copyright (C) 1999, 2003 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
#endif
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
-
return test;
}
VERIFY( (arg1 && arg2) == (arg1 and arg2) );
VERIFY( (arg1 && int1) == (arg1 and int1) );
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
-
return test;
}
// 1999-08-23 bkoz
-// Copyright (C) 1999, 2001, 2002 Free Software Foundation
+// Copyright (C) 1999, 2001, 2002, 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
VERIFY( !obj.traps );
VERIFY( !obj.tinyness_before );
VERIFY( obj.round_style == std::round_toward_zero );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
-
return test;
}
VERIFY( std::numeric_limits<signed long long>::digits10 == 18 );
VERIFY( std::numeric_limits<unsigned long long>::digits10 == 19 );
}
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
-
return test;
}
VERIFY( !std::numeric_limits<unsigned long>::is_iec559 );
VERIFY( !std::numeric_limits<long long>::is_iec559 );
VERIFY( !std::numeric_limits<unsigned long long>::is_iec559 );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
-
return test;
}
str05.append(str05.begin(), str05.begin() + str05.find('r'));
VERIFY( str05 == "point bolivar, texaspoint boliva" );
VERIFY( str05 != str01 );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
str05.append(str05.begin(), str05.begin() + str05.find(L'r'));
VERIFY( str05 == L"point bolivar, texaspoint boliva" );
VERIFY( str05 != str01 );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
default:
pass = false; //should not get here
}
-
-#ifdef DEBUG_ASSERT
- assert(pass);
-#endif
-
+ VERIFY(pass);
return 0;
}
pass = false; //should not get here
}
-#ifdef DEBUG_ASSERT
- assert(pass);
-#endif
-
+ VERIFY(pass);
return 0;
}
catch(...) {
VERIFY( false );
}
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
VERIFY( str03[0] == 'x' );
// need to also test for const begin/const end
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
std::string str13 = str12;
*p2 = 'e';
VERIFY( str12 != str13 );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
catch(...) {
VERIFY( false );
}
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
VERIFY( str03[0] == L'x' );
// need to also test for const begin/const end
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
+ VERIFY(test);
return test;
}
std::wstring str13 = str12;
*p2 = L'e';
VERIFY( str12 != str13 );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
VERIFY( csz01 == csz02 );
csz01 = str01.find('/');
VERIFY( csz01 == npos );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
csz01 = str01.find_first_of('z');
csz02 = str01.size() - 1;
VERIFY( csz01 == csz02 );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
VERIFY( csz01 == 0 );
csz01 = str04.find_first_not_of('S');
VERIFY( csz01 == npos );
-
-#ifdef DEBUG_ASSERT
- VERIFY(test);
-#endif
return test;
}
VERIFY( csz01 == csz02 );
csz01 = str01.find(L'/');
VERIFY( csz01 == npos );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
csz01 = str01.find_first_of(L'z');
csz02 = str01.size() - 1;
VERIFY( csz01 == csz02 );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
VERIFY( csz01 == 0 );
csz01 = str04.find_first_not_of(L'S');
VERIFY( csz01 == npos );
-
-#ifdef DEBUG_ASSERT
- VERIFY(test);
-#endif
return test;
}
csz01 = str03.size();
str03.insert(str03.end(), str01.begin(), str01.end());
VERIFY( str03 == "baker beach, san franciscorodeo beach, marin" );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
str01.insert(0, str01.c_str());
VERIFY( str01 == "Everything was beautiful, and nothing hurt"
"Everything was beautiful, and nothing hurt");
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
csz01 = str03.size();
str03.insert(str03.end(), str01.begin(), str01.end());
VERIFY( str03 == L"baker beach, san franciscorodeo beach, marin" );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
str01.insert(0, str01.c_str());
VERIFY( str01 == L"Everything was beautiful, and nothing hurt"
L"Everything was beautiful, and nothing hurt");
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
std::string hello_world;
std::cout << hello_world;
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
VERIFY( oss.good() );
std::string str_tmp = oss.str();
VERIFY( str_tmp.size() == expected_size );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
}
int main()
}
VERIFY( count == 2 * size );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
}
int main()
size_type i06 = str02.capacity();
VERIFY( i05 == i03 );
VERIFY( i06 <= i04 );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
}
int main()
VERIFY( i < 3 );
VERIFY( static_cast<bool>(iss.rdstate() & std::ios_base::failbit) );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
}
int main()
std::wstring hello_world;
std::wcout << hello_world;
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
VERIFY( oss.good() );
std::wstring str_tmp = oss.str();
VERIFY( str_tmp.size() == expected_size );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
}
int main()
}
VERIFY( count == 2 * size );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
}
int main()
size_type i06 = str02.capacity();
VERIFY( i05 == i03 );
VERIFY( i06 <= i04 );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
}
int main()
VERIFY( i < 3 );
VERIFY( static_cast<bool>(iss.rdstate() & std::ios_base::failbit) );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
}
int main()
// printf("2:%s\n", str1.c_str()); //str1 is gone
const char* p2 = str1.c_str();
return 0;
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
-
- return test;
}
int main()
str_4 = 'o' + str_4;
str_4 = 'c' + str_4;
VERIFY( str_4 == str_3 );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
-
return 0;
}
// wprintf("2:%s\n", str1.c_str()); //str1 is gone
const wchar_t* p2 = str1.c_str();
return 0;
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
-
- return test;
}
int main()
str_4 = L'o' + str_4;
str_4 = L'c' + str_4;
VERIFY( str_4 == str_3 );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
-
return 0;
}
std::find(x.rbegin(), x.rend(), 'l').base(), ar,
ar + sizeof(ar) / sizeof(ar[0]));
VERIFY( x == "jeHelloo" );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
std::find(x.rbegin(), x.rend(), L'l').base(), ar,
ar + sizeof(ar) / sizeof(ar[0]));
VERIFY( x == L"jeHelloo" );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
VERIFY( csz01 == csz02 );
csz01 = str01.rfind('/');
VERIFY( csz01 == npos );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
VERIFY( pos == 1 );
pos = z.find_last_of('X');
VERIFY( pos == std::string::npos );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
VERIFY( pos == 0 );
pos = z.find_last_not_of("Xa");
VERIFY( pos == 1 );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
int main()
VERIFY( csz01 == csz02 );
csz01 = str01.rfind(L'/');
VERIFY( csz01 == npos );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
VERIFY( pos == 1 );
pos = z.find_last_of(L'X');
VERIFY( pos == std::wstring::npos );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
VERIFY( pos == 0 );
pos = z.find_last_not_of(L"Xa");
VERIFY( pos == 1 );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
int main()
catch(...) {
VERIFY( false );
}
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
catch(...) {
VERIFY( false );
}
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
// 1999-06-08 bkoz
-// Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc.
+// Copyright (C) 1999, 2000, 2002, 2003 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
catch(...) {
VERIFY( false );
}
-
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
}
VERIFY( z1.to_ulong() == 0 );
- VERIFY( ( z1.to_string<char,char_traits<char>,allocator<char> >().empty() ) );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
+ VERIFY( (z1.to_string<char,char_traits<char>,allocator<char> >().empty() ));
return test;
}
// 2000-01-15 Anders Widell <awl@hem.passagen.se>
-// Copyright (C) 2000 Free Software Foundation, Inc.
+// Copyright (C) 2000, 2003 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
VERIFY( do_test<511>() );
VERIFY( do_test<513>() );
VERIFY( do_test<997>() );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
std::bitset<66> b;
b <<= 400;
VERIFY( b.count() == 0 );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return test;
}
void test01()
{
// 1
- bool test = true;
std::vector< A<B> > vec01;
std::vector< A<B> > vec02(5);
typedef std::vector< A<B> >::size_type size_type;
vec01 = vec02;
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
}
// 2
std::vector<int> v5(M, 7);
VERIFY(std::equal(v5.begin(), v5.end(), B));
VERIFY(std::equal(B, B + M, v5.begin()));
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
}
// libstdc++/6513
void test04()
{
- bool test = true;
const char* c_strings[5] = { "1", "2", "3", "4", "5" };
std::vector<std::string> strings(c_strings, c_strings + 5);
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
}
// 2000-09-06
// bkoz
-// Copyright (C) 2000 Free Software Foundation, Inc.
+// Copyright (C) 2000, 2003 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
{
VERIFY( false );
}
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
-
return test;
}
// 1999-06-28 bkoz
-// Copyright (C) 1999, 2001 Free Software Foundation, Inc.
+// Copyright (C) 1999, 2001, 2003 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
c = *++istrb_it28;
VERIFY( c == slit01[++i] );
}
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
-
return test;
}
// 24.3.1 Iterator traits
// (basic_string and vector implementations)
//
-// Copyright (C) 1999 Philip Martin
+// Copyright (C) 1999, 2003 Free Software Foundation, Inc.
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
failures += test6642();
-#ifdef DEBUG_ASSERT
- assert (failures == 0);
-#endif
-
+ VERIFY(failures == 0);
return 0;
}
// 2001-04-30 Benjamin Kosnik <bkoz@redhat.com>
-// Copyright (C) 2001 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2003 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
tmp = ostrs00.str();
VERIFY ( tmp != str01 );
VERIFY ( tmp != str02 );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
-
return test;
}
-// Copyright (C) 2000 Free Software Foundation, Inc.
+// { dg-do compile }
+// Copyright (C) 2000, 2003 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
{
foo* c = std::lower_bound(a, b, x);
}
-
-void test01()
-{
- bool test = true;
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
-}
-
-int main()
-{
- return 0;
-}
// 2000-02-10
// Petter Urkedal <petter@matfys.lth.se>
-// Copyright (C) 2000 Free Software Foundation
+// Copyright (C) 2000, 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
VERIFY( flteq(z.real(), x) );
VERIFY( flteq(z.imag(), y) );
VERIFY( ch == '#' );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
return 0;
}
int
test_fail(std::string str)
{
+ bool test = true;
std::complex<R> z;
std::istringstream iss(str);
iss >> z;
-#ifdef DEBUG_ASSERT
- assert(iss.fail() && !iss.bad());
-#endif
+ VERIFY( iss.fail() && !iss.bad() );
return 0;
}
ss_01 >> pi;
std::printf ("%x %x\n", pi, po);
VERIFY( po == pi );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
-
return test;
}
VERIFY( n == 20000 );
char c = is.peek();
VERIFY( c == 65 );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
-
return test;
}
istr >> l01; // _M_in_end set completely incorrectly here.
VERIFY( l01 == 12220101 );
VERIFY( istr.rdstate() == std::ios_base::eofbit );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
-
return test;
}
is >> c; // EOF
VERIFY( c == ',' );
VERIFY( static_cast<bool>(is.rdstate() & std::ios_base::failbit) );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
}
int main()
VERIFY( static_cast<bool>(is.rdstate() & std::ios_base::failbit) );
VERIFY( static_cast<bool>(is.rdstate() & std::ios_base::eofbit) );
is.clear();
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
}
int main()
is >> h2;
VERIFY( h2 == 2212322 );
VERIFY( static_cast<bool>(is.rdstate() & std::ios_base::eofbit) );
-
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
}
int main()
test = f1 == 2456;
VERIFY( f2 == 0.00567 );
VERIFY( c == '-' );
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
-
return test;
}
is_05.ignore();
is_05 >> n;
VERIFY( n == 16 );
-
-#ifdef DEBUG_ASSERT
- assert(test);
-#endif
-
return test;
}
using namespace std;
-#ifndef DEBUG_ASSERT
+#ifndef _GLIBCXX_ASSERT
# define TEST_NUMPUT_VERBOSE 1
#endif
using namespace std;
-#ifndef DEBUG_ASSERT
+#ifndef _GLIBCXX_ASSERT
# define TEST_NUMPUT_VERBOSE 1
#endif
return "untested"
}
set cxx [transform "g++"]
- set cxxflags "-ggdb3 -DDEBUG_ASSERT"
+ set cxxflags "-ggdb3 -D_GLIBCXX_ASSERT"
set includes "-I./"
} else {
# If we find a testsuite_flags file, we're testing in the build dir.
set includes [exec sh $flags_file --build-includes]
} else {
set cxx [transform "g++"]
- set cxxflags "-ggdb3 -DDEBUG_ASSERT"
+ set cxxflags "-ggdb3 -D_GLIBCXX_ASSERT"
set includes "-I${srcdir}"
}
}
# If a testcase doesn't have special options, use these.
global DEFAULT_CXXFLAGS
if ![info exists DEFAULT_CXXFLAGS] then {
- set DEFAULT_CXXFLAGS "-DDEBUG_ASSERT"
+ set DEFAULT_CXXFLAGS "-D_GLIBCXX_ASSERT"
}
# Initialize 'dg' last or dejagnu exits with an error...
if (res != NULL)
{
string preLC_ALL = res;
- for (func_callback::const_iterator i = l.begin(); i != l.end(); ++i)
- (*i)();
+ const func_callback::test_type* tests = l.tests();
+ for (int i = 0; i < l.size(); ++i)
+ (*tests[i])();
string postLC_ALL= setlocale(LC_ALL, NULL);
VERIFY( preLC_ALL == postLC_ALL );
}
const char* oldENV = getenv(env);
if (!setenv(env, name, 1))
{
- for (func_callback::const_iterator i = l.begin(); i != l.end(); ++i)
- (*i)();
+ const func_callback::test_type* tests = l.tests();
+ for (int i = 0; i < l.size(); ++i)
+ (*tests[i])();
setenv(env, oldENV ? oldENV : "", 1);
}
else
// This file provides the following:
//
-// 1) VERIFY(), via DEBUG_ASSERT, from Brent Verner <brent@rcfile.org>.
+// 1) VERIFY(), via _GLIBCXX_ASSERT, from Brent Verner <brent@rcfile.org>.
// This file is included in the various testsuite programs to provide
// #define(able) assert() behavior for debugging/testing. It may be
// a suitable location for other furry woodland creatures as well.
#include <bits/c++config.h>
#include <bits/functexcept.h>
#include <cstddef>
-#ifdef DEBUG_ASSERT
+#ifdef _GLIBCXX_ASSERT
# include <cassert>
# define VERIFY(fn) assert(fn)
#else
# define VERIFY(fn) test &= (fn)
#endif
-#include <list>
#include <locale>
#ifdef _GLIBCXX_HAVE_UNISTD_H
# include <unistd.h>
// Simple callback structure for variable numbers of tests (all with
// same signature). Assume all unit tests are of the signature
// void test01();
- typedef void (*test_func) (void);
- typedef std::list<test_func> func_callback;
+ class func_callback
+ {
+ public:
+ typedef void (*test_type) (void);
+
+ private:
+ int _M_size;
+ test_type _M_tests[15];
+
+ public:
+ func_callback(): _M_size(0) { };
+
+ int
+ size() const { return _M_size; }
+
+ const test_type*
+ tests() const { return _M_tests; }
+
+ void
+ push_back(test_type test)
+ {
+ _M_tests[_M_size] = test;
+ ++_M_size;
+ }
+ };
+
// Run select unit tests after setting global locale.
void
// USA.
// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* } }
-// { dg-options "-DDEBUG_ASSERT -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* } }
-// { dg-options "-DDEBUG_ASSERT -pthreads" { target *-*-solaris* } }
+// { dg-options "-D_GLIBCXX_ASSERT -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* } }
+// { dg-options "-D_GLIBCXX_ASSERT -pthreads" { target *-*-solaris* } }
#include <ext/rope>
#include <cstring>