Commit 1ecba09e by Paolo Carlini Committed by Paolo Carlini

sum_diff.cc: Use VERIFY.

2004-11-18  Paolo Carlini  <pcarlini@suse.de>

	* testsuite/26_numerics/numeric/sum_diff.cc: Use VERIFY.
	* testsuite/ext/array_allocator/1.cc: Likewise.
	* testsuite/ext/array_allocator/2.cc: Likewise.
	* testsuite/ext/array_allocator/3.cc: Likewise.
	* testsuite/ext/enc_filebuf/char/13598.cc: Likewise.

From-SVN: r90878
parent c4cb37ea
2004-11-18 Paolo Carlini <pcarlini@suse.de> 2004-11-18 Paolo Carlini <pcarlini@suse.de>
* testsuite/26_numerics/numeric/sum_diff.cc: Use VERIFY.
* testsuite/ext/array_allocator/1.cc: Likewise.
* testsuite/ext/array_allocator/2.cc: Likewise.
* testsuite/ext/array_allocator/3.cc: Likewise.
* testsuite/ext/enc_filebuf/char/13598.cc: Likewise.
2004-11-18 Paolo Carlini <pcarlini@suse.de>
* include/bits/locale_facets.tcc (num_get<>::do_get(void*&)): * include/bits/locale_facets.tcc (num_get<>::do_get(void*&)):
If the failbit is set, don't set it again. If the failbit is set, don't set it again.
(money_get<>::_M_extract): Minor stylistic tweak: consistently (money_get<>::_M_extract): Minor stylistic tweak: consistently
......
// Copyright (C) 2001 Free Software Foundation, Inc. // Copyright (C) 2001, 2004 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#include <algorithm> #include <algorithm>
#include <numeric> #include <numeric>
#include <cassert> #include <testsuite_hooks.h>
int A[] = {1, 4, 9, 16, 25, 36, 49, 64, 81, 100}; int A[] = {1, 4, 9, 16, 25, 36, 49, 64, 81, 100};
int B[] = {1, 3, 5, 7, 9, 11, 13, 15, 17, 19}; int B[] = {1, 3, 5, 7, 9, 11, 13, 15, 17, 19};
...@@ -30,13 +30,15 @@ const int N = sizeof(A) / sizeof(int); ...@@ -30,13 +30,15 @@ const int N = sizeof(A) / sizeof(int);
void void
test01() test01()
{ {
int D[N]; bool test __attribute__((unused)) = true;
std::adjacent_difference(A, A + N, D); int D[N];
assert(std::equal(D, D + N, B));
std::partial_sum(D, D + N, D); std::adjacent_difference(A, A + N, D);
assert(std::equal(D, D + N, A)); VERIFY( std::equal(D, D + N, B) );
std::partial_sum(D, D + N, D);
VERIFY( std::equal(D, D + N, A) );
} }
int int
......
...@@ -25,9 +25,9 @@ ...@@ -25,9 +25,9 @@
// invalidate any other reasons why the executable file might be covered by // invalidate any other reasons why the executable file might be covered by
// the GNU General Public License. // the GNU General Public License.
#include <cassert>
#include <string> #include <string>
#include <ext/array_allocator.h> #include <ext/array_allocator.h>
#include <testsuite_hooks.h>
typedef char char_type; typedef char char_type;
typedef std::char_traits<char_type> traits_type; typedef std::char_traits<char_type> traits_type;
...@@ -37,6 +37,8 @@ array_type extern_array; ...@@ -37,6 +37,8 @@ array_type extern_array;
void test01() void test01()
{ {
bool test __attribute__((unused)) = true;
using std::basic_string; using std::basic_string;
typedef __gnu_cxx::array_allocator<char_type, array_type> allocator_type; typedef __gnu_cxx::array_allocator<char_type, array_type> allocator_type;
typedef basic_string<char_type, traits_type, allocator_type> string_type; typedef basic_string<char_type, traits_type, allocator_type> string_type;
...@@ -50,11 +52,11 @@ void test01() ...@@ -50,11 +52,11 @@ void test01()
} }
catch(std::bad_alloc& obj) catch(std::bad_alloc& obj)
{ {
assert(true); VERIFY( true );
} }
catch(...) catch(...)
{ {
assert(false); VERIFY( false );
} }
} }
......
...@@ -25,10 +25,10 @@ ...@@ -25,10 +25,10 @@
// invalidate any other reasons why the executable file might be covered by // invalidate any other reasons why the executable file might be covered by
// the GNU General Public License. // the GNU General Public License.
#include <cassert>
#include <string> #include <string>
#include <iostream> #include <iostream>
#include <ext/array_allocator.h> #include <ext/array_allocator.h>
#include <testsuite_hooks.h>
typedef char char_type; typedef char char_type;
typedef std::char_traits<char_type> traits_type; typedef std::char_traits<char_type> traits_type;
...@@ -38,6 +38,8 @@ array_type extern_array; ...@@ -38,6 +38,8 @@ array_type extern_array;
void test01() void test01()
{ {
bool test __attribute__((unused)) = true;
using std::basic_string; using std::basic_string;
typedef __gnu_cxx::array_allocator<char_type, array_type> allocator_type; typedef __gnu_cxx::array_allocator<char_type, array_type> allocator_type;
typedef basic_string<char_type, traits_type, allocator_type> string_type; typedef basic_string<char_type, traits_type, allocator_type> string_type;
...@@ -52,11 +54,11 @@ void test01() ...@@ -52,11 +54,11 @@ void test01()
} }
catch(std::bad_alloc& obj) catch(std::bad_alloc& obj)
{ {
assert(false); VERIFY( false );
} }
catch(...) catch(...)
{ {
assert(false); VERIFY( false );
} }
s.append(1, 'c'); s.append(1, 'c');
......
...@@ -25,9 +25,9 @@ ...@@ -25,9 +25,9 @@
// invalidate any other reasons why the executable file might be covered by // invalidate any other reasons why the executable file might be covered by
// the GNU General Public License. // the GNU General Public License.
#include <cassert>
#include <string> #include <string>
#include <ext/array_allocator.h> #include <ext/array_allocator.h>
#include <testsuite_hooks.h>
typedef char char_type; typedef char char_type;
typedef std::char_traits<char_type> traits_type; typedef std::char_traits<char_type> traits_type;
...@@ -37,6 +37,8 @@ array_type extern_array; ...@@ -37,6 +37,8 @@ array_type extern_array;
void test01() void test01()
{ {
bool test __attribute__((unused)) = true;
using std::basic_string; using std::basic_string;
typedef __gnu_cxx::array_allocator<char_type, array_type> allocator_type; typedef __gnu_cxx::array_allocator<char_type, array_type> allocator_type;
typedef basic_string<char_type, traits_type, allocator_type> string_type; typedef basic_string<char_type, traits_type, allocator_type> string_type;
...@@ -51,11 +53,11 @@ void test01() ...@@ -51,11 +53,11 @@ void test01()
} }
catch(std::bad_alloc& obj) catch(std::bad_alloc& obj)
{ {
assert(true); VERIFY( true );
} }
catch(...) catch(...)
{ {
assert(false); VERIFY( false );
} }
} }
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include <locale> #include <locale>
#include <cstring> #include <cstring>
#include <cassert> #include <testsuite_hooks.h>
#ifdef _GLIBCXX_USE___ENC_TRAITS #ifdef _GLIBCXX_USE___ENC_TRAITS
#include <ext/enc_filebuf.h> #include <ext/enc_filebuf.h>
#endif #endif
...@@ -26,8 +26,9 @@ ...@@ -26,8 +26,9 @@
int main() int main()
{ {
#ifdef _GLIBCXX_USE___ENC_TRAITS #ifdef _GLIBCXX_USE___ENC_TRAITS
const char* str = "Hello, world!\n"; bool test __attribute__((unused)) = true;
const char* str = "Hello, world!\n";
std::locale loc(std::locale::classic(), std::locale loc(std::locale::classic(),
new std::codecvt<char, char, std::__enc_traits>()); new std::codecvt<char, char, std::__enc_traits>());
std::__enc_traits st("ISO-8859-1", "ISO-8859-1"); std::__enc_traits st("ISO-8859-1", "ISO-8859-1");
...@@ -39,8 +40,8 @@ int main() ...@@ -39,8 +40,8 @@ int main()
int s = fb.pubsync(); int s = fb.pubsync();
fb.close(); fb.close();
assert(n == std::strlen(str)); VERIFY( n == std::strlen(str) );
assert(s == 0); VERIFY( s == 0 );
#endif #endif
return 0; return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment