summaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/26_numerics
diff options
context:
space:
mode:
Diffstat (limited to 'libstdc++-v3/testsuite/26_numerics')
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/operators/serialize.cc16
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/independent_bits_engine/operators/serialize.cc16
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/operators/serialize.cc30
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/mersenne_twister_engine/operators/serialize.cc16
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/operators/serialize.cc16
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/subtract_with_carry_engine/operators/serialize.cc16
6 files changed, 97 insertions, 13 deletions
diff --git a/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/operators/serialize.cc b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/operators/serialize.cc
index 7aec649c03b..4249d975a82 100644
--- a/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/operators/serialize.cc
+++ b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/operators/serialize.cc
@@ -3,7 +3,7 @@
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010, 2011 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
@@ -46,6 +46,20 @@ test01()
str >> v;
VERIFY( u == v );
+ for (unsigned i = 0; i < 1000; ++i)
+ VERIFY( u() == v() );
+
+ str.clear();
+ str << v;
+
+ u();
+ u();
+ u();
+
+ str >> u;
+ VERIFY( u == v );
+ for (unsigned i = 0; i < 1000; ++i)
+ VERIFY( u() == v() );
}
int main()
diff --git a/libstdc++-v3/testsuite/26_numerics/random/independent_bits_engine/operators/serialize.cc b/libstdc++-v3/testsuite/26_numerics/random/independent_bits_engine/operators/serialize.cc
index 332931addfa..32a5157608c 100644
--- a/libstdc++-v3/testsuite/26_numerics/random/independent_bits_engine/operators/serialize.cc
+++ b/libstdc++-v3/testsuite/26_numerics/random/independent_bits_engine/operators/serialize.cc
@@ -3,7 +3,7 @@
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010, 2011 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
@@ -44,6 +44,20 @@ test01()
str >> v;
VERIFY( u == v );
+ for (unsigned i = 0; i < 1000; ++i)
+ VERIFY( u() == v() );
+
+ str.clear();
+ str << v;
+
+ u();
+ u();
+ u();
+
+ str >> u;
+ VERIFY( u == v );
+ for (unsigned i = 0; i < 1000; ++i)
+ VERIFY( u() == v() );
}
int main()
diff --git a/libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/operators/serialize.cc b/libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/operators/serialize.cc
index 8b67e5f3a33..a83b22ef651 100644
--- a/libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/operators/serialize.cc
+++ b/libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/operators/serialize.cc
@@ -3,7 +3,7 @@
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010, 2011 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
@@ -33,15 +33,29 @@ test01()
bool test __attribute__((unused)) = true;
std::stringstream str;
- std::minstd_rand0 a;
- std::minstd_rand0 b;
+ std::minstd_rand0 u;
+ std::minstd_rand0 v;
- a(); // advance
- str << a;
- VERIFY( !(a == b) );
+ u(); // advance
+ str << u;
+ VERIFY( !(u == v) );
- str >> b;
- VERIFY( a == b );
+ str >> v;
+ VERIFY( u == v );
+ for (unsigned i = 0; i < 1000; ++i)
+ VERIFY( u() == v() );
+
+ str.clear();
+ str << v;
+
+ u();
+ u();
+ u();
+
+ str >> u;
+ VERIFY( u == v );
+ for (unsigned i = 0; i < 1000; ++i)
+ VERIFY( u() == v() );
}
int main()
diff --git a/libstdc++-v3/testsuite/26_numerics/random/mersenne_twister_engine/operators/serialize.cc b/libstdc++-v3/testsuite/26_numerics/random/mersenne_twister_engine/operators/serialize.cc
index 03fb8b04fa1..7c90e3d390f 100644
--- a/libstdc++-v3/testsuite/26_numerics/random/mersenne_twister_engine/operators/serialize.cc
+++ b/libstdc++-v3/testsuite/26_numerics/random/mersenne_twister_engine/operators/serialize.cc
@@ -3,7 +3,7 @@
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010, 2011 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
@@ -47,6 +47,20 @@ test01()
str >> v;
VERIFY( u == v );
+ for (unsigned i = 0; i < 1000; ++i)
+ VERIFY( u() == v() );
+
+ str.clear();
+ str << v;
+
+ u();
+ u();
+ u();
+
+ str >> u;
+ VERIFY( u == v );
+ for (unsigned i = 0; i < 1000; ++i)
+ VERIFY( u() == v() );
}
int main()
diff --git a/libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/operators/serialize.cc b/libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/operators/serialize.cc
index 578e4959371..c7b15d1ba15 100644
--- a/libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/operators/serialize.cc
+++ b/libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/operators/serialize.cc
@@ -3,7 +3,7 @@
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010, 2011 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
@@ -46,6 +46,20 @@ test01()
str >> v;
VERIFY( u == v );
+ for (unsigned i = 0; i < 1000; ++i)
+ VERIFY( u() == v() );
+
+ str.clear();
+ str << v;
+
+ u();
+ u();
+ u();
+
+ str >> u;
+ VERIFY( u == v );
+ for (unsigned i = 0; i < 1000; ++i)
+ VERIFY( u() == v() );
}
int main()
diff --git a/libstdc++-v3/testsuite/26_numerics/random/subtract_with_carry_engine/operators/serialize.cc b/libstdc++-v3/testsuite/26_numerics/random/subtract_with_carry_engine/operators/serialize.cc
index e4129fc8df5..1e2e53ac593 100644
--- a/libstdc++-v3/testsuite/26_numerics/random/subtract_with_carry_engine/operators/serialize.cc
+++ b/libstdc++-v3/testsuite/26_numerics/random/subtract_with_carry_engine/operators/serialize.cc
@@ -3,7 +3,7 @@
//
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010, 2011 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
@@ -43,6 +43,20 @@ test01()
str >> v;
VERIFY( u == v );
+ for (unsigned i = 0; i < 1000; ++i)
+ VERIFY( u() == v() );
+
+ str.clear();
+ str << v;
+
+ u();
+ u();
+ u();
+
+ str >> u;
+ VERIFY( u == v );
+ for (unsigned i = 0; i < 1000; ++i)
+ VERIFY( u() == v() );
}
int main()