<command>make</command>, or via options for the DejaGnu test framework
(described below). The latter approach uses the
<option>--target_board</option> option that was shown earlier.
- For example, to run the tests with <option>-O1 -D_GLIBCXX_ASSERT</option>
+ For example, to run the tests with <option>-O1 -D_GLIBCXX_ASSERTIONS</option>
you could use:
<programlisting> make RUNTESTFLAGS=--target_board=unix/-O1/-D_GLIBCXX_ASSERTIONS</programlisting>
</para>
echo ${CC}
;;
--cxxflags)
- CXXFLAGS_default="-D_GLIBCXX_ASSERT -fmessage-length=0 -fno-show-column"
+ CXXFLAGS_default="-fmessage-length=0 -fno-show-column"
CXXFLAGS_config="@SECTION_FLAGS@ @EXTRA_CXX_FLAGS@"
echo ${CXXFLAGS_default} ${CXXFLAGS_config}
;;
// libstdc++/50594
void test01()
{
- bool test __attribute__((unused)) = true;
-
{
std::string s = "Hello World, this is not a small string.";
}
// libstdc++/14493
void test01()
{
- bool test __attribute__((unused)) = true;
using namespace std;
bad_alloc ba;
// libstdc++/14493
void test01()
{
- bool test __attribute__((unused)) = true;
using namespace std;
bad_cast bc;
// libstdc++/14493
void test01()
{
- bool test __attribute__((unused)) = true;
using namespace std;
bad_exception be;
// libstdc++/14493
void test01()
{
- bool test __attribute__((unused)) = true;
using namespace std;
bad_typeid bt;
// PR libstdc++/38732
void test01 ()
{
- bool test __attribute__((unused)) = true;
try {
throw 0;
} catch(...) {
// libstdc++/14493
void test01()
{
- bool test __attribute__((unused)) = true;
using namespace std;
exception e;
void
test01()
{
- bool test __attribute__((unused)) = true;
+ bool test = true;
{
// Put some non-zero bytes on the stack
void* p __attribute__((unused)) = &test;
void test01()
{
- bool test __attribute__((unused)) = true;
using namespace std;
exception_ptr ep = current_exception();
void test02()
{
- bool test __attribute__((unused)) = true;
using namespace std;
try {
void test03()
{
- bool test __attribute__((unused)) = true;
using namespace std;
try {
void test04()
{
- bool test __attribute__((unused)) = true;
using namespace std;
try {
void test01()
{
- bool test __attribute__((unused)) = true;
using namespace std;
may_destruct = false;
void test02()
{
- bool test __attribute__((unused)) = true;
using namespace std;
may_destruct = false;
void test03()
{
- bool test __attribute__((unused)) = true;
using namespace std;
may_destruct = false;
void test04()
{
- bool test __attribute__((unused)) = true;
using namespace std;
may_destruct = false;
void test05()
{
- bool test __attribute__((unused)) = true;
using namespace std;
may_destruct = false;
void test06()
{
- bool test __attribute__((unused)) = true;
using namespace std;
may_destruct = false;
void test99()
{
- bool test __attribute__((unused)) = true;
using namespace std;
may_destruct = false;
void test01()
{
- bool test __attribute__((unused)) = true;
-
std::exception_ptr p = std::make_exception_ptr(0);
VERIFY( !(p == 0) );
void test02()
{
- bool test __attribute__((unused)) = true;
using namespace std;
try {
void test01()
{
- bool test __attribute__((unused)) = true;
-
std::nested_exception e;
VERIFY( e.nested_ptr() == 0 );
void test02()
{
- bool test __attribute__((unused)) = true;
-
try
{
throw 42;
void test01()
{
- bool test __attribute__((unused)) = true;
-
try
{
throw std::nested_exception();
void test02()
{
- bool test __attribute__((unused)) = true;
-
try
{
throw 42;
void test01()
{
- bool test __attribute__((unused)) = false;
+ bool test = false;
try
{
void test02()
{
- bool test __attribute__((unused)) = false;
+ bool test = false;
try
{
void test03()
{
- bool test __attribute__((unused)) = false;
+ bool test = false;
try
{
void test01()
{
- bool test __attribute__((unused)) = false;
+ bool test = false;
try
{
void test01()
{
- bool test __attribute__((unused)) = false;
+ bool test = false;
try
{
void test02()
{
- bool test __attribute__((unused)) = false;
+ bool test = false;
try
{
void test03()
{
- bool test __attribute__((unused)) = false;
+ bool test = false;
try
{
void
do_test()
{
- bool test __attribute__((unused)) = true;
-
typedef std::numeric_limits<T> char_type;
typedef std::numeric_limits<R> impl_type;
#include <testsuite_hooks.h>
// libstdc++/5045
-bool test03()
+void test03()
{
- bool test __attribute__((unused)) = true;
-
VERIFY( std::numeric_limits<bool>::digits10 == 0 );
if (__CHAR_BIT__ == 8)
{
VERIFY( std::numeric_limits<signed long long>::digits10 == 18 );
VERIFY( std::numeric_limits<unsigned long long>::digits10 == 19 );
}
- return test;
}
int main()
template<typename T>
void do_test_aux()
{
- bool test __attribute__((unused)) = true;
typedef std::numeric_limits<T> cv_limits;
typedef std::numeric_limits<typename std::remove_cv<T>::type> limits;
template<typename T>
void test_epsilon()
{
- bool test __attribute__((unused)) = true;
T epsilon = std::numeric_limits<T>::epsilon();
T one = 1;
}
// libstdc++/8949
-bool test04()
+void test04()
{
- bool test __attribute__((unused)) = true;
-
VERIFY( !std::numeric_limits<short>::is_iec559 );
VERIFY( !std::numeric_limits<unsigned short>::is_iec559 );
VERIFY( !std::numeric_limits<int>::is_iec559 );
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 );
- return test;
}
int main()
void test_sign()
{
- bool test __attribute__((unused)) = true;
VERIFY( std::numeric_limits<char>::is_signed == char_is_signed );
VERIFY( std::numeric_limits<signed char>::is_signed == true );
VERIFY( std::numeric_limits<unsigned char>::is_signed == false );
void
do_test(std::true_type)
{
- bool test __attribute__((unused)) = true;
T limits_min = std::numeric_limits<T>::min();
VERIFY( std::numeric_limits<T>::lowest() == limits_min );
}
void
do_test(std::false_type)
{
- bool test __attribute__((unused)) = true;
T limits_max = std::numeric_limits<T>::max();
VERIFY( std::numeric_limits<T>::lowest() == -limits_max );
}
void
test01()
{
- bool test __attribute__((unused)) = true;
-
VERIFY( std::numeric_limits<bool>::max_digits10 == 0 );
VERIFY( std::numeric_limits<char>::max_digits10 == 0 );
VERIFY( std::numeric_limits<signed char>::max_digits10 == 0 );
template<typename T>
void test_extrema()
{
- bool test __attribute__((unused)) = true;
T limits_min = std::numeric_limits<T>::min();
T limits_max = std::numeric_limits<T>::max();
T extrema_min = extrema<T>::min;
};
-bool test01()
+void test01()
{
- bool test __attribute__((unused)) = true;
std::numeric_limits< A<B> > obj;
VERIFY( !obj.is_specialized );
VERIFY( !obj.traps );
VERIFY( !obj.tinyness_before );
VERIFY( obj.round_style == std::round_toward_zero );
- return test;
}
// test linkage of the generic bits
void test01()
{
- bool test __attribute__((unused)) = true;
using namespace std;
class Abraca { };
int main()
{
- bool test __attribute__((unused)) = true;
-
__gnu_test::test_category c1;
__gnu_test::test_category c2(c1); // { dg-error "deleted" }
int main()
{
- bool test __attribute__((unused)) = true;
-
// 1
__gnu_test::test_category c1;
__gnu_test::test_derived_category c2;
int main()
{
- bool test __attribute__((unused)) = true;
-
__gnu_test::test_category c1;
__gnu_test::test_derived_category c2;
VERIFY( c1 == c1 );
int main()
{
- bool test __attribute__((unused)) = true;
-
__gnu_test::test_category c1;
__gnu_test::test_derived_category c2;
VERIFY( !(c1 != c1) );
int main()
{
- bool test __attribute__((unused)) = true;
-
// 1
std::error_code e1;
VERIFY( e1.value() == 0 );
// libstdc++/39882
void test01()
{
- bool test __attribute__((unused)) = true;
-
std::error_code ec1(my_err);
VERIFY( ec1 == make_error_code(my_err) );
}
// libstdc++/39882
void test01()
{
- bool test __attribute__((unused)) = true;
-
std::error_code ec2;
ec2 = my_err;
VERIFY( ec2 == make_error_code(my_err) );
// unspecified bool operator positive tests
int main()
{
- bool test __attribute__((unused)) = true;
-
// 1
std::error_code e1;
if (static_cast<bool>(e1))
// unspecified bool operator positive tests
int main()
{
- bool test __attribute__((unused)) = true;
-
std::error_code e1;
std::error_code e2(std::make_error_code(std::errc::operation_not_supported));
// unspecified bool operator positive tests
int main()
{
- bool test __attribute__((unused)) = true;
-
std::error_code e1;
std::error_code e2(std::make_error_code(std::errc::operation_not_supported));
void test01()
{
- bool test __attribute__((unused)) = true;
-
// 1
std::error_condition e1;
VERIFY( e1.value() == 0 );
// libstdc++/39881
void test01()
{
- bool test __attribute__((unused)) = true;
-
std::error_condition ec1(my_err);
VERIFY( ec1 == make_error_condition(my_err) );
}
// libstdc++/39881
void test01()
{
- bool test __attribute__((unused)) = true;
-
std::error_condition ec2;
ec2 = my_err;
VERIFY( ec2 == make_error_condition(my_err) );
// unspecified bool operator positive tests
void test01()
{
- bool test __attribute__((unused)) = true;
-
// 1
std::error_condition e1;
if (static_cast<bool>(e1))
// unspecified bool operator positive tests
void test01()
{
- bool test __attribute__((unused)) = true;
-
std::error_condition e1;
std::error_condition e2(std::errc::operation_not_supported);
// unspecified bool operator positive tests
void test01()
{
- bool test __attribute__((unused)) = true;
-
std::error_condition e1;
std::error_condition e2(std::errc::operation_not_supported);
// libstdc++/1972
void test01()
{
- bool test __attribute__((unused)) = true;
std::string s("lack of sunlight, no water error");
// 1
void test02()
{
- bool test __attribute__((unused)) = true;
std::string s("lack of sunlight error");
std::domain_error x(s);
void test03()
{
- bool test __attribute__((unused)) = true;
try
{ throw fuzzy_logic(); }
catch(const fuzzy_logic& obj)
void test04()
{
- bool test __attribute__((unused)) = true;
const std::string s("CA ISO emergency once again:immediate power down");
const char* strlit1 = "wish I lived in Palo Alto";
const char* strlit2 = "...or Santa Barbara";
{
typedef std::logic_error test_type;
- bool test __attribute__((unused)) = true;
const std::string xxx(10000, 'x');
test_type t(xxx);
VERIFY( std::strcmp(t.what(), xxx.c_str()) == 0 );
// libstdc++/1972
void test01()
{
- bool test __attribute__((unused)) = true;
std::string s("lack of sunlight, no water error");
// 1
void test02()
{
- bool test __attribute__((unused)) = true;
std::string s("lack of sunlight error");
std::range_error x(s);
void test03()
{
- bool test __attribute__((unused)) = true;
try
{ throw fuzzy_logic(); }
catch(const fuzzy_logic& obj)
void test04()
{
- bool test __attribute__((unused)) = true;
const std::string s("CA ISO emergency once again:immediate power down");
const char* strlit1 = "wish I lived in Palo Alto";
const char* strlit2 = "...or Santa Barbara";
{
typedef std::runtime_error test_type;
- bool test __attribute__((unused)) = true;
const std::string xxx(10000, 'x');
test_type t(xxx);
VERIFY( std::strcmp(t.what(), xxx.c_str()) == 0 );
int main()
{
- bool test __attribute__((unused)) = true;
const std::string s("too late: boulangerie out of pain au raisin");
const std::error_code
e(std::make_error_code(std::errc::operation_not_supported));
// libstdc++/1972
void test01()
{
- bool test __attribute__((unused)) = true;
string s("lack of sunlight, no water error");
// 1
void test02()
{
- bool test __attribute__((unused)) = true;
string s("lack of sunlight error");
system_error x(error_code(), s);
void test03()
{
- bool test __attribute__((unused)) = true;
try
{ throw fuzzy_logic(); }
catch(const fuzzy_logic& obj)
void test04()
{
- bool test __attribute__((unused)) = true;
const std::string s("CA ISO emergency once again:immediate power down");
const char* strlit1 = "wish I lived in Palo Alto";
const char* strlit2 = "...or Santa Barbara";
// Make sure each invocation of what() doesn't grow the message.
void test01()
{
- bool test __attribute__((unused)) = true;
std::string s("after nine thirty, this request cannot be met");
std::system_error obj =
{
typedef std::system_error test_type;
- bool test __attribute__((unused)) = true;
const std::string xxx(10000, 'x');
test_type t(std::error_code(), xxx);
VERIFY( std::string(t.what()).find(xxx) != std::string::npos );
void test01()
{
- bool test __attribute__((unused)) = true;
using namespace __gnu_test;
OverloadedAddress* ao1 = new OverloadedAddress();
void
test01()
{
- bool test __attribute__((unused)) = true;
-
size_t space = 100;
void* ptr = new char[space];
char* const orig_ptr = static_cast<char*>(ptr);
void
test01()
{
- bool test __attribute__((unused)) = true;
-
int i = 0;
void* ptr = &i;
auto space = sizeof(i);
void test01()
{
- bool test __attribute__((unused)) = true;
std::allocator<gnu> obj;
// NB: These should work for various size allocation and
void test01()
{
using namespace std;
- bool test __attribute__((unused)) = true;
list<Bob> uniset;
uniset.push_back(Bob());
// libstdc++/8230
void test02()
{
- bool test __attribute__((unused)) = true;
+ bool test = true;
try
{
std::allocator<int> alloc;
void test01()
{
- bool test __attribute__((unused)) = true;
-
typedef std::allocator_traits<hintable_allocator<X>> traits_type;
traits_type::allocator_type a;
traits_type::const_void_pointer v;
void test02()
{
- bool test __attribute__((unused)) = true;
-
typedef std::allocator_traits<unhintable_allocator<X>> traits_type;
traits_type::allocator_type a;
traits_type::const_void_pointer v;
void test01()
{
- bool test __attribute__((unused)) = true;
-
typedef std::allocator_traits<fake_allocator<X>> traits_type;
traits_type::allocator_type a;
X* p = traits_type::allocate(a, 1);
void test01()
{
- bool test __attribute__((unused)) = true;
-
typedef std::allocator_traits<allocator_with_destroy<X>> traits_type;
traits_type::allocator_type a;
X* p = 0;
void test02()
{
- bool test __attribute__((unused)) = true;
-
typedef std::allocator_traits<allocator_without_destroy<X>> traits_type;
traits_type::allocator_type a;
char buf[sizeof(X)];
void test01()
{
- bool test __attribute__((unused)) = true;
-
typedef std::allocator_traits<maxsize_allocator<X>> traits_type;
traits_type::allocator_type a;
auto size = a.max_size();
void test02()
{
- bool test __attribute__((unused)) = true;
-
typedef std::allocator_traits<unsized_allocator<X>> traits_type;
traits_type::allocator_type a;
auto size = std::numeric_limits<traits_type::size_type>::max();
void test03()
{
- bool test __attribute__((unused)) = true;
-
typedef std::allocator_traits<unsized_allocator<int>> traits_type;
traits_type::allocator_type a;
auto size = std::numeric_limits<traits_type::size_type>::max();
a1 = a2;
} catch (...) {
auto x = std::any_cast<Good>(a1);
- assert(del_count == 0);
- assert(a1.has_value());
+ VERIFY( del_count == 0 );
+ VERIFY( a1.has_value() );
std::any_cast<Good>(a1);
}
std::any a3 = Good();
a3 = a4;
} catch (...) {
auto x = std::any_cast<Good>(a1);
- assert(del_count == 0);
- assert(a1.has_value());
+ VERIFY( del_count == 0 );
+ VERIFY( a1.has_value() );
std::any_cast<Good>(a1);
}
}
test01()
{
reset_count_struct __attribute__((unused)) reset;
- bool test __attribute__((unused)) = true;
std::auto_ptr<A> A_default;
VERIFY( A_default.get() == 0 );
test02()
{
reset_count_struct __attribute__((unused)) reset;
- bool test __attribute__((unused)) = true;
std::auto_ptr<A> A_from_A(new A);
std::auto_ptr<B> B_from_B(new B);
test03()
{
reset_count_struct __attribute__((unused)) reset;
- bool test __attribute__((unused)) = true;
std::auto_ptr<A> A_from_ptr_A;
std::auto_ptr<A> A_from_ptr_B;
test04()
{
reset_count_struct __attribute__((unused)) reset;
- bool test __attribute__((unused)) = true;
{/*lifetine scope*/
std::auto_ptr<A> A_from_A(new A);
int
test05()
{
- bool test __attribute__((unused)) = true;
reset_count_struct __attribute__((unused)) reset;
pimpl<A>();
test06()
{
reset_count_struct __attribute__((unused)) reset;
- bool test __attribute__((unused)) = true;
std::auto_ptr<A> A_from_A(new A);
std::auto_ptr<A> A_from_A_ptr(A_from_A.release());
int
test07()
{
- bool test __attribute__((unused)) = true;
reset_count_struct __attribute__((unused)) reset;
drain(source<A>());
// Operations on empty function<> objects
void test01()
{
- bool test __attribute__((unused)) = true;
-
VERIFY( std::bind(std::plus<int>(), 3, 5)() == 8 );
VERIFY( std::bind(std::minus<int>(), 3, 5)() == -2 );
VERIFY( std::bind<int>(std::plus<int>(), 3, 5)() == 8 );
void test01()
{
- bool test __attribute__((unused)) = true;
using std::bind;
using std::ref;
::X x = { true };
void test01()
{
- bool test __attribute__((unused)) = true;
-
auto b0 = std::bind(X());
VERIFY( b0() == 0 );
void test02()
{
- bool test __attribute__((unused)) = true;
-
auto b0 = std::bind<int>(X());
VERIFY( b0() == 0 );
void test03()
{
- bool test __attribute__((unused)) = true;
-
auto b0 = std::bind(X(), 0, _1, _2);
VERIFY( b0(0, 0) == 0 );
void test04()
{
- bool test __attribute__((unused)) = true;
-
auto b0 = std::bind<int>(X(), 0, _1, _2);
VERIFY( b0(0, 0) == 0 );
void test01()
{
- bool test __attribute__((unused)) = true;
-
const auto b0 = std::bind(X());
VERIFY( b0() == 0 );
// Operations on empty function<> objects
void test01()
{
- bool test __attribute__((unused)) = true;
using namespace std::placeholders;
int five = 5;
// Operations on empty function<> objects
void test01()
{
- bool test __attribute__((unused)) = true;
using namespace std::placeholders;
int five = 5;
// Operations on empty function<> objects
void test01()
{
- bool test __attribute__((unused)) = true;
using std::bind;
using std::ref;
::X x;
void test01()
{
- bool test __attribute__((unused)) = true;
-
int counter = 0;
std::bind(&inc, _1)(counter);
VERIFY(counter == 1 );
void test02()
{
- bool test __attribute__((unused)) = true;
-
int counter = 0;
std::bind(Inc(), _1)(counter);
VERIFY(counter == 1 );
void test01()
{
- bool test __attribute__((unused)) = true;
using std::common_type;
using std::is_same;
void test02()
{
- bool test __attribute__((unused)) = true;
using std::common_type;
using std::is_same;
void
test01()
{
- bool test __attribute__((unused)) = true;
using namespace std::chrono;
duration<int> d0(3);
void
test02()
{
- bool test __attribute__((unused)) = true;
using namespace std::chrono;
duration<int> d7(3);
void
test01()
{
- bool test __attribute__((unused)) = true;
using namespace std::chrono;
duration<int> d0(12);
void test01()
{
- bool test __attribute__((unused)) = true;
using namespace std::chrono;
typedef duration<std::int64_t, std::ratio<36 * 24 * 36525>> Years;
// DR 2020
void test01()
{
- bool test __attribute__((unused)) = true;
using namespace std::chrono;
constexpr duration<int> d0(12);
void
test01()
{
- bool test __attribute__((unused)) = true;
using namespace std::chrono;
const duration<int> d0(17);
void
test01()
{
- bool test __attribute__((unused)) = true;
using namespace std::chrono;
duration<int> d0(12);
void
test01()
{
- bool test __attribute__((unused)) = true;
using std::chrono::duration;
int r = 3;
void
test01()
{
- bool test __attribute__((unused)) = true;
using namespace std::chrono;
duration<int> d0(3);
void test01()
{
- bool test __attribute__((unused)) = true;
using std::enable_if;
// Positive tests.
void test01()
{
- bool test __attribute__((unused)) = true;
using std::enable_if;
// Negative tests.
typedef enable_if<false, int>::type test2_type;
}
-// { dg-error "does not name a type" "" { target *-*-* } 31 }
+// { dg-error "does not name a type" "" { target *-*-* } 30 }
void test01()
{
- bool test __attribute__((unused)) = true;
auto x1 = std::make_shared<X>(), x2 = std::make_shared<X>();
*x1 = *x2;
VERIFY( x1->shared_from_this() != x2->shared_from_this() );
void
test02()
{
- bool test __attribute__((unused)) = true;
-
struct DefaultConstructible
{
DefaultConstructible(int i = 0) : value(i) { }
void
test03()
{
- bool test __attribute__((unused)) = true;
-
int (*fp)(int);
std::exchange(fp, &f);
VERIFY( fp != nullptr );
void test() const
{
- bool test __attribute__((unused)) = true;
VERIFY( data_ == 3 );
}
};
void test() const
{
- bool test __attribute__((unused)) = true;
VERIFY( data_ == 3 );
}
};
void test() const
{
- bool test __attribute__((unused)) = true;
VERIFY( data_ == 3 );
}
};
using namespace __gnu_test;
-bool test __attribute__((unused)) = true;
-
// Operations on empty function<> objects
void test01()
{
using namespace __gnu_test;
-bool test __attribute__((unused)) = true;
-
// Put function pointers into function<> wrappers
void test02()
{
using namespace __gnu_test;
-bool test __attribute__((unused)) = true;
-
// Put nearly-matching function pointers into function<> wrappers
void test03()
{
using namespace __gnu_test;
-bool test __attribute__((unused)) = true;
-
// Put function objects into function<> wrappers
void test04()
{
void test01()
{
- bool test __attribute__((unused)) = true;
-
using std::function;
using std::ref;
using namespace __gnu_test;
-bool test __attribute__((unused)) = true;
-
// Put member pointers into function<> wrappers
void test05()
{
using namespace __gnu_test;
-bool test __attribute__((unused)) = true;
-
struct secret {};
struct noncopyable_function_object_type
using namespace __gnu_test;
-bool test __attribute__((unused)) = true;
-
// Put reference_wrappers to function pointers into function<> wrappers
void test07()
{
using namespace __gnu_test;
-bool test __attribute__((unused)) = true;
-
// Put reference_wrappers to member pointers
void test08()
{
using namespace __gnu_test;
-bool test __attribute__((unused)) = true;
-
// Put function objects into a void-returning function<> wrapper
void test09()
{
void test01()
{
- bool test __attribute__((unused)) = true;
-
typedef std::function<int()> function;
function fo(f1);
void test01()
{
- bool test __attribute__((unused)) = true;
-
typedef std::function<int()> function;
function fo(f1);
// DR 660. Missing Bitwise Operations.
void test01()
{
- bool test __attribute__((unused)) = true;
-
for (int i1 = 0; i1 < 1000; ++i1)
for (int i2 = 0; i2 < 1000; ++i2)
{
void
test_bit_flip_set()
{
- bool test __attribute__((unused)) = true;
const unsigned long N = SAMPLES;
const unsigned long k = N/100;
const unsigned int len = 67;
void
test_bit_string_set()
{
- bool test __attribute__((unused)) = true;
const unsigned long N = SAMPLES;
const unsigned long k = N/100;
std::vector<std::string> set;
void
test_document_words()
{
- bool test __attribute__((unused)) = true;
const std::string f_name = "thirty_years_among_the_dead_preproc.txt";
std::ifstream in(f_name);
VERIFY( in.is_open() );
void
test_numeric_pattern_set()
{
- bool test __attribute__((unused)) = true;
const unsigned long N = SAMPLES;
const unsigned long k = N/100;
std::vector<std::string> set;
void
test_uniform_random()
{
- bool test __attribute__((unused)) = true;
std::srand(137);
std::unordered_set<std::string> set;
std::string s;
void
do_test()
{
- bool test __attribute__((unused)) = true;
-
typedef T value_type;
typedef std::hash<value_type> hash_type;
using std::size_t;
double
score_from_varying_position(string s, unsigned int index)
{
- bool test __attribute__((unused)) = true;
unsigned int bits_in_hash_code = sizeof(size_t) * 8;
// We'll iterate through all 256 vals for s[index], leaving the rest
void
quality_test()
{
- bool test __attribute__((unused)) = true;
srand(137);
double sum_of_scores = 0;
for (unsigned int i = 0; i < num_quality_tests; i++)
void test01()
{
- bool test __attribute__((unused)) = true;
const bool* p = &std::integral_constant<bool, true>::value;
VERIFY( p );
}
void test01()
{
- bool test __attribute__((unused)) = true;
using std::true_type;
using std::false_type;
// libstdc++/24808
void test01()
{
- bool test __attribute__((unused)) = true;
using std::is_function;
using namespace __gnu_test;
// libstdc++/24808
void test01()
{
- bool test __attribute__((unused)) = true;
using std::is_object;
using namespace __gnu_test;
void
test01()
{
- bool test __attribute__((unused)) = true;
-
noexcept_move_copy nemc1;
auto nemc2 __attribute__((unused)) = std::move_if_noexcept(nemc1);
VERIFY( nemc1 == false );
void
test01()
{
- bool test __attribute__((unused)) = true;
-
constexpr simple s { 5 };
constexpr auto s2 __attribute__((unused)) = std::move_if_noexcept(s);
}
int
test01()
{
- bool test __attribute__((unused)) = true;
-
// test empty shared_ptrs compare equivalent
std::owner_less<std::shared_ptr<A>> less;
std::owner_less<std::weak_ptr<A>> wless;
int
test02()
{
- bool test __attribute__((unused)) = true;
-
std::owner_less<std::shared_ptr<A>> less;
std::owner_less<std::weak_ptr<A>> wless;
int
test03()
{
- bool test __attribute__((unused)) = true;
-
std::owner_less<std::shared_ptr<A>> less;
std::owner_less<std::weak_ptr<A>> wless;
int
test04()
{
- bool test __attribute__((unused)) = true;
-
std::owner_less<std::shared_ptr<A>> less;
std::shared_ptr<A> a[3];
// heterogeneous
void test01()
{
- bool test __attribute__((unused)) = true;
-
std::pair<bool, long> p_bl_1(true, 433);
std::pair<bool, long> p_bl_2 = std::make_pair(true, 433);
VERIFY( p_bl_1 == p_bl_2 );
// homogeneous
void test02()
{
- bool test __attribute__((unused)) = true;
-
std::pair<bool, bool> p_bb_1(true, false);
std::pair<bool, bool> p_bb_2 = std::make_pair(true, false);
VERIFY( p_bb_1 == p_bb_2 );
// const
void test03()
{
- bool test __attribute__((unused)) = true;
-
const std::pair<bool, long> p_bl_1(true, 433);
const std::pair<bool, long> p_bl_2 = std::make_pair(true, 433);
VERIFY( p_bl_1 == p_bl_2 );
// const&
void test04()
{
- bool test __attribute__((unused)) = true;
const gnu_obj& obj1 = gnu_obj(5);
const std::pair<const char*, gnu_obj> p_sg_1("enlightenment", obj1);
const std::pair<const char*, gnu_obj> p_sg_2 =
void
test1()
{
- bool test __attribute__((unused)) = true;
typedef std::pair<int, float> pair_type;
constexpr pair_type p1 __attribute__((unused)) = std::make_pair(22, 22.222);
}
#include <utility>
#include <testsuite_hooks.h>
-bool test __attribute__((unused)) = true;
-
void
test1()
{
void test01()
{
- bool test __attribute__((unused)) = true;
-
std::pair<type_one, type_zero> pp0(std::piecewise_construct,
std::forward_as_tuple(-3),
std::forward_as_tuple());
void test01()
{
- bool test __attribute__((unused)) = true;
typedef __gnu_test::uneq_allocator<double> ua_type;
ua_type one(1), two(2);
void
test01()
{
- bool test __attribute__((unused)) = true;
-
VERIFY(( std::ratio_equal<std::ratio<2,6>, std::ratio<1,3>>::value == 1 ));
VERIFY(( std::ratio_equal<std::ratio<2,6>, std::ratio<1,4>>::value == 0 ));
void
test02()
{
- bool test __attribute__((unused)) = true;
-
VERIFY( (std::ratio_less<std::ratio<1,4>, std::ratio<1,3>>::value == 1) );
VERIFY( (std::ratio_less<std::ratio<-1,3>, std::ratio<1,3>>::value == 1) );
void
test01()
{
- bool test __attribute__((unused)) = true;
-
// No overflow with same denominator
VERIFY( (std::ratio_less<std::ratio<M - 2, M>,
std::ratio<M - 1, M>>::value == 1) );
void
test01()
{
- bool test __attribute__((unused)) = true;
-
VERIFY( (std::ratio_less<std::ratio<59, 29131>,
std::ratio<59, 29129>>::value == 1) );
VERIFY( (std::ratio_less<std::ratio<4733, 13>,
void
test01()
{
- bool test __attribute__((unused)) = true;
-
std::ratio<1,3> r0;
std::ratio<2,6> r1;
std::ratio<2,-6> r2;
// libstdc++/45866
void test01()
{
- bool test __attribute__((unused)) = true;
-
typedef std::ratio<1, 4>::type r_type1;
typedef std::ratio<3, 2>::type r_type2;
// libstdc++/47913
void test01()
{
- bool test __attribute__((unused)) = true;
using namespace std;
const intmax_t m1 = (intmax_t)1 << (4 * sizeof(intmax_t) - 1);
void
test01()
{
- bool test __attribute__((unused)) = true;
-
std::ratio_add<std::ratio<3,8>, std::ratio<5,12>>::type r;
VERIFY( r.num == 19 );
void
test02()
{
- bool test __attribute__((unused)) = true;
std::ratio_subtract<std::ratio<3,8>, std::ratio<5,12>>::type r;
VERIFY( r.num == -1 );
void
test03()
{
- bool test __attribute__((unused)) = true;
std::ratio_multiply<std::ratio<3,8>, std::ratio<5,12>>::type r;
VERIFY( r.num == 5 );
void
test04()
{
- bool test __attribute__((unused)) = true;
std::ratio_divide<std::ratio<3,8>, std::ratio<5,12>>::type r;
VERIFY( r.num == 9 );
void
test01()
{
- bool test __attribute__((unused)) = true;
-
std::ratio_add<one_over_max, one_over_max>::type r1;
VERIFY( r1.num == two_over_max::num);
void
test02()
-{
- bool test __attribute__((unused)) = true;
-
+{
std::ratio_subtract<one_over_max, one_over_max>::type r1;
VERIFY( r1.num == 0);
void
test01()
{
- bool test __attribute__((unused)) = true;
-
std::ratio_multiply<
std::ratio<2, INTMAX_MAX>,
std::ratio<INTMAX_MAX, 2>>::type r1;
void
test02()
-{
- bool test __attribute__((unused)) = true;
-
+{
std::ratio_divide<
std::ratio<INTMAX_MAX, 2>,
std::ratio<INTMAX_MAX, 2>>::type r1;
using namespace __gnu_test;
-bool test __attribute__((unused)) = true;
-
struct X
{
typedef int result_type;
void test01()
{
- bool test __attribute((unused)) = false;
-
typedef std::scoped_allocator_adaptor<Element::allocator_type> alloc1_type;
typedef std::vector<Element, alloc1_type> EltVec;
void test02()
{
- bool test __attribute((unused)) = false;
-
typedef std::scoped_allocator_adaptor<Element::allocator_type> inner_alloc_type;
typedef std::vector<Element, inner_alloc_type> EltVec;
void
test_def()
{
- bool test __attribute((unused)) = false;
-
typedef std::pair<A, B> test_type;
typedef uneq_allocator<test_type> alloc_type;
typedef scoped_allocator_adaptor<alloc_type, alloc_type> alloc_adaptor;
void
test_copying()
{
- bool test __attribute((unused)) = false;
-
typedef std::pair<A, B> test_type;
typedef uneq_allocator<test_type> alloc_type;
typedef scoped_allocator_adaptor<alloc_type, alloc_type> alloc_adaptor;
void
test_moving()
{
- bool test __attribute((unused)) = false;
-
typedef std::pair<A, B> test_type;
typedef uneq_allocator<test_type> alloc_type;
typedef scoped_allocator_adaptor<alloc_type, alloc_type> alloc_adaptor;
test01()
{
reset_count_struct __attribute__((unused)) reset;
- bool test __attribute__((unused)) = true;
std::shared_ptr<A> a;
test01()
{
reset_count_struct __attribute__((unused)) reset;
- bool test __attribute__((unused)) = true;
std::shared_ptr<A> a(new A);
std::auto_ptr<B> b(new B);
int
test01()
{
- bool test __attribute__((unused)) = true;
-
std::shared_ptr<A> a;
std::auto_ptr<B> b;
a = std::move(b); // { dg-error "here" }
test01()
{
reset_count_struct __attribute__((unused)) reset;
- bool test __attribute__((unused)) = true;
std::shared_ptr<A> a1;
std::shared_ptr<A> a2(new A);
test02()
{
reset_count_struct __attribute__((unused)) reset;
- bool test __attribute__((unused)) = true;
std::shared_ptr<A> a;
std::shared_ptr<B> b(new B);
test01()
{
reset_count_struct __attribute__((unused)) reset;
- bool test __attribute__((unused)) = true;
std::shared_ptr<A> a;
int
test01()
{
- bool test __attribute__((unused)) = true;
-
std::shared_ptr<A> a;
std::unique_ptr<A> u;
a = u; // { dg-error "" }
int
test01()
{
- bool test __attribute__((unused)) = true;
-
// test empty shared_ptrs compare equivalent
std::shared_ptr<A> p1;
std::shared_ptr<B> p2;
int
test02()
{
- bool test __attribute__((unused)) = true;
-
std::shared_ptr<A> A_default;
std::shared_ptr<A> A_from_A(new A);
int
test01()
{
- bool test __attribute__((unused)) = true;
-
std::less<std::shared_ptr<A>> less;
// test empty shared_ptrs compare equivalent
std::shared_ptr<A> p1;
int
test02()
{
- bool test __attribute__((unused)) = true;
-
std::less<std::shared_ptr<A>> less;
std::shared_ptr<A> empty;
int
test03()
{
- bool test __attribute__((unused)) = true;
-
std::less<std::shared_ptr<A>> less;
A a;
int test01()
{
- bool test __attribute__((unused)) = true;
+ bool test = true;
std::shared_ptr<A> a;
std::shared_ptr<bool> b1(a, &test);
int
test02()
{
- bool test __attribute__((unused)) = true;
-
std::shared_ptr<A> a(new A);
std::shared_ptr<int> i1(a, &a->i);
VERIFY( i1.use_count() == 2 );
int
test03()
{
- bool test __attribute__((unused)) = true;
-
std::shared_ptr<B> b(new B);
std::shared_ptr<A> a1(b, b.get());
std::shared_ptr<A> a2(b, &b->a);
int
test01()
{
- bool test __attribute__((unused)) = true;
tracker_allocator_counter::reset();
std::shared_ptr<A> p1(new A, deletefunc, tracker_allocator<A>());
int
test02()
{
- bool test __attribute__((unused)) = true;
tracker_allocator_counter::reset();
std::shared_ptr<A> p1(new A, deletefunc, tracker_allocator<A>());
int
test01()
{
- bool test __attribute__((unused)) = true;
-
std::auto_ptr<A> a(new A);
std::shared_ptr<A> a2(std::move(a));
VERIFY( a.get() == 0 );
int test01()
{
reset_count_struct __attribute__((unused)) reset;
- bool test __attribute__((unused)) = true;
std::shared_ptr<A> a1;
std::shared_ptr<A> a2(a1);
test02()
{
reset_count_struct __attribute__((unused)) reset;
- bool test __attribute__((unused)) = true;
std::shared_ptr<A> a1(new A);
std::shared_ptr<A> a2(a1);
test03()
{
reset_count_struct __attribute__((unused)) reset;
- bool test __attribute__((unused)) = true;
std::shared_ptr<B> b(new B);
std::shared_ptr<A> a(b);
test04()
{
reset_count_struct __attribute__((unused)) reset;
- bool test __attribute__((unused)) = true;
std::shared_ptr<B> b(new B, &deleter);
std::shared_ptr<A> a(b);
int
test01()
{
- bool test __attribute__((unused)) = true;
-
std::shared_ptr<A> a;
VERIFY( a.get() == 0 );
int test01()
{
reset_count_struct __attribute__((unused)) reset;
- bool test __attribute__((unused)) = true;
std::shared_ptr<A> a1;
std::shared_ptr<A> a2(std::move(a1));
test02()
{
reset_count_struct __attribute__((unused)) reset;
- bool test __attribute__((unused)) = true;
std::shared_ptr<A> a1(new A);
std::shared_ptr<A> a2(std::move(a1));
test03()
{
reset_count_struct __attribute__((unused)) reset;
- bool test __attribute__((unused)) = true;
std::shared_ptr<B> b(new B);
std::shared_ptr<A> a(std::move(b));
test04()
{
reset_count_struct __attribute__((unused)) reset;
- bool test __attribute__((unused)) = true;
std::shared_ptr<B> b(new B, D());
std::shared_ptr<A> a(std::move(b));
test05()
{
reset_count_struct __attribute__((unused)) reset;
- bool test __attribute__((unused)) = true;
std::shared_ptr<A> a(std::move(std::shared_ptr<A>(new A)));
VERIFY( a.use_count() == 1 );
void
test01()
{
- bool test __attribute__((unused)) = true;
-
std::shared_ptr<int> p = nullptr;
VERIFY( p.get() == nullptr );
VERIFY( p.use_count() == 0 );
void
test02()
{
- bool test __attribute__((unused)) = true;
-
deleter d;
std::shared_ptr<int> p(nullptr, std::ref(d));
VERIFY( p.get() == nullptr );
void
test03()
{
- bool test __attribute__((unused)) = true;
-
deleter d;
__gnu_test::tracker_allocator<int> a;
std::shared_ptr<int> p(nullptr, std::ref(d), a);
int
test01()
{
- bool test __attribute__((unused)) = true;
-
A * const a = 0;
std::shared_ptr<A> p(a);
VERIFY( p.get() == 0 );
int
test02()
{
- bool test __attribute__((unused)) = true;
-
A * const a = new A;
std::shared_ptr<A> p(a);
VERIFY( p.get() == a );
int
test03()
{
- bool test __attribute__((unused)) = true;
-
B * const b = new B;
std::shared_ptr<A> p(b);
VERIFY( p.get() == b );
int
test01()
{
- bool test __attribute__((unused)) = true;
-
std::unique_ptr<A> up(new A);
std::shared_ptr<A> sp(std::move(up));
VERIFY( up.get() == 0 );
int
test01()
{
- bool test __attribute__((unused)) = true;
-
std::unique_ptr<A[]> up(new A[2]);
std::shared_ptr<A> sp(std::move(up));
VERIFY( up.get() == 0 );
void
test01()
{
- bool test __attribute__((unused)) = true;
-
std::unique_ptr<A, D> up(new A, D());
{
std::shared_ptr<A> sp(std::move(up));
void
test02()
{
- bool test __attribute__((unused)) = true;
-
D::count = 0;
std::unique_ptr<A, D> up;
{
int
test01()
{
- bool test __attribute__((unused)) = true;
-
D d = D();
std::unique_ptr<A, D&> up(new A, d);
{
int
test01()
{
- bool test __attribute__((unused)) = true;
-
D d;
std::unique_ptr<A, D&> p1(new A, d);
int
test01()
{
- bool test __attribute__((unused)) = true;
-
std::unique_ptr<A> a;
std::shared_ptr<A> p(a); // { dg-error "" }
int
test01()
{
- bool test __attribute__((unused)) = true;
-
A * const a = new A;
std::shared_ptr<A> a1(a);
std::weak_ptr<A> wa(a1);
void
test01()
{
- bool test __attribute__((unused)) = true;
reset_count_struct __attribute__((unused)) reset;
{
void
test02()
{
- bool test __attribute__((unused)) = true;
reset_count_struct __attribute__((unused)) reset;
std::shared_ptr<A> p1;
#include <memory>
#include <new>
-#include <testsuite_hooks.h>
struct A
{
- void* operator new(size_t n) { return new char[sizeof(A)]; }
- void operator delete(void* p, size_t) { delete (char*)p; }
+ void* operator new(size_t n) { return new char[sizeof(A)]; }
+ void operator delete(void* p, size_t) { delete (char*)p; }
};
// 20.6.6.2.6 shared_ptr creation [util.smartptr.shared.create]
void
test01()
{
- bool test __attribute__((unused)) = true;
-
std::shared_ptr<A> p = std::make_shared<A>();
}
void
process(std::shared_ptr<A> a)
{
- bool test __attribute__((unused)) = true;
-
VERIFY( a.get() != 0 );
VERIFY( a.use_count() == 1 );
}
void
test01()
{
- bool test __attribute__((unused)) = true;
reset_count_struct __attribute__((unused)) reset;
{
void
test02()
{
- bool test __attribute__((unused)) = true;
reset_count_struct __attribute__((unused)) reset;
std::shared_ptr<A> p1;
test01()
{
reset_count_struct __attribute__((unused)) reset;
- bool test __attribute__((unused)) = true;
{
std::shared_ptr<A> a;
test02()
{
reset_count_struct __attribute__((unused)) reset;
- bool test __attribute__((unused)) = true;
std::shared_ptr<A> a;
{
test03()
{
reset_count_struct __attribute__((unused)) reset;
- bool test __attribute__((unused)) = true;
{
std::shared_ptr<A> a1(new B);
void test01()
{
- bool test __attribute__((unused)) = true;
-
struct T { };
std::shared_ptr<T> s0(new T);
// libstdc++/24595
void test01()
{
- bool test __attribute__((unused)) = true;
-
std::shared_ptr<int> sp;
VERIFY( !get_deleter<void(*)(int*)>(sp) );
}
void test01()
{
- bool test __attribute__((unused)) = true;
-
std::shared_ptr<A> spA = std::make_shared<A>();
VERIFY( spA.get() != 0 );
void test02()
{
- bool test __attribute__((unused)) = true;
-
std::shared_ptr<B> spB = std::make_shared<B>(99);
VERIFY( spB->i == 99 );
int
test01()
{
- bool test __attribute__((unused)) = true;
-
std::shared_ptr<A> p(new A);
std::ostringstream buf;
buf << p;
int
test01()
{
- bool test __attribute__((unused)) = true;
-
A * const a1 = new A;
A * const a2 = new A;
std::shared_ptr<A> p1(a1);
int
test01()
{
- bool test __attribute__((unused)) = true;
-
A * const a = new A;
std::shared_ptr<A> p1(a);
std::shared_ptr<A> p2(p1);
int
test02()
{
- bool test __attribute__((unused)) = true;
-
A * const a = new A;
B * const b = new B;
std::shared_ptr<A> p1(a);
int
test03()
{
- bool test __attribute__((unused)) = true;
-
{
std::shared_ptr<A> p1;
p1.reset(new B, D());
int
test01()
{
- bool test __attribute__((unused)) = true;
tracker_allocator_counter::reset();
{
int
test01()
{
- bool test __attribute__((unused)) = true;
-
const std::shared_ptr<A> p1(new A);
p1.reset(); // { dg-error "" }
int
test01()
{
- bool test __attribute__((unused)) = true;
-
A * const a1 = new A;
A * const a2 = new A;
std::shared_ptr<A> p1(a1);
int
test01()
{
- bool test __attribute__((unused)) = true;
-
const std::shared_ptr<A> p1(new A);
std::shared_ptr<A> p2(new A);
p1.swap(p2); // { dg-error "discards qualifiers" }
void
test01()
{
- bool test __attribute__((unused)) = true;
-
const std::shared_ptr<A> p1;
VERIFY( static_cast<bool>(p1) == false );
const std::shared_ptr<A> p2(p1);
void
test02()
{
- bool test __attribute__((unused)) = true;
-
std::shared_ptr<A> p1(new A);
VERIFY( static_cast<bool>(p1) );
std::shared_ptr<A> p2(p1);
void
test03()
{
- bool test __attribute__((unused)) = true;
-
std::shared_ptr<A> p1(new A);
std::shared_ptr<A> p2(p1);
p2.reset(new A);
void
test01()
{
- bool test __attribute__((unused)) = true;
-
A * const a = new A;
const std::shared_ptr<A> p(a);
VERIFY( p.get() == a );
void
test02()
{
- bool test __attribute__((unused)) = true;
-
A * const a = new A;
const std::shared_ptr<A> p(a);
VERIFY( &*p == a );
void
test03()
{
- bool test __attribute__((unused)) = true;
-
A * const a = new A;
const std::shared_ptr<A> p(a);
VERIFY( &p->i == &a->i );
void
test04()
{
- bool test __attribute__((unused)) = true;
-
#if !(defined _GLIBCXX_DEBUG && defined _GLIBCXX_DEBUG_PEDANTIC)
std::shared_ptr<int> p;
auto np = p.operator->();
void
test01()
{
- bool test __attribute__((unused)) = true;
-
// test empty shared_ptrs compare equivalent
std::shared_ptr<A> p1;
std::shared_ptr<B> p2;
void
test02()
{
- bool test __attribute__((unused)) = true;
-
std::shared_ptr<A> a0;
std::shared_ptr<A> a1(new A);
void
test03()
{
- bool test __attribute__((unused)) = true;
-
std::shared_ptr<A> p1(new A());
std::shared_ptr<int> p2(p1, &p1->i);
VERIFY( !p1.owner_before(p2) && !p2.owner_before(p1) );
void
test01()
{
- bool test __attribute__((unused)) = true;
-
const std::shared_ptr<A> p1;
VERIFY( !p1.unique() );
const std::shared_ptr<A> p2(p1);
void
test02()
{
- bool test __attribute__((unused)) = true;
-
std::shared_ptr<A> p1(new A);
VERIFY( p1.unique() );
std::shared_ptr<A> p2(p1);
void
test03()
{
- bool test __attribute__((unused)) = true;
-
std::shared_ptr<A> p1(new A);
std::shared_ptr<A> p2(p1);
p2.reset(new A);
void
test01()
{
- bool test __attribute__((unused)) = true;
-
const std::shared_ptr<A> p1;
VERIFY( p1.use_count() == 0 );
const std::shared_ptr<A> p2(p1);
void
test02()
{
- bool test __attribute__((unused)) = true;
-
std::shared_ptr<A> p1(new A);
std::shared_ptr<A> p2(p1);
p1.reset();
void
test03()
{
- bool test __attribute__((unused)) = true;
-
std::shared_ptr<A> p1(new A);
std::shared_ptr<A> p2(p1);
p2.reset(new B);
void
test01()
{
- bool test __attribute__((unused)) = true;
sp_vector_t obj_pool(POOL_SIZE);
for(auto& obj : obj_pool)
void
test01()
{
- bool test __attribute__((unused)) = true;
sp_vector_t obj_pool(POOL_SIZE);
for(auto& obj : obj_pool)
void test01()
{
- bool test __attribute__((unused)) = true;
-
int inarray[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
const int size = sizeof(inarray) / sizeof(int);
void test01()
{
- bool test __attribute__((unused)) = true;
-
int inarray[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
const int size = sizeof(inarray) / sizeof(int);
int main(void)
{
- bool test __attribute__((unused)) = true;
-
typedef std::pair<junk*, std::ptrdiff_t> pair_type;
pair_type results = std::get_temporary_buffer<junk>(5);
void
test01()
{
- bool test __attribute__((unused)) = true;
using namespace std::chrono;
time_point<system_clock> t1;
void
test01()
{
- bool test __attribute__((unused)) = true;
using namespace std::chrono;
time_point<system_clock> t1, t2;
void
test02()
{
- bool test __attribute__((unused)) = true;
using namespace std::chrono;
time_point<system_clock> t1;
void
test01()
{
- bool test __attribute__((unused)) = true;
using namespace std::chrono;
time_point<system_clock> t1(seconds(1));
int main()
{
- bool test __attribute__((unused)) = true;
using namespace std::chrono;
typedef time_point<system_clock> time_type;
// libstdc++/48476
void test01()
{
- bool test __attribute__((unused)) = true;
-
std::shared_ptr<int> p(new int()), q, r;
std::tuple<std::shared_ptr<int>&, int> t0(p, 23), t1(q, 0);
using namespace std;
-bool test __attribute__((unused)) = true;
-
#define TEST1(x) VERIFY( x == x && !(x != x) && x <= x && !(x < x) )
int
void test01()
{
- bool test __attribute__((unused)) = true;
using std::allocator_arg;
using std::tuple;
using std::make_tuple;
void test02()
{
- bool test __attribute__((unused)) = true;
using std::allocator_arg;
using std::tuple;
using std::make_tuple;
int
main()
{
- bool test __attribute__((unused)) = true;
-
tuple<> ta;
tuple<> tb;
ta = tb;
void
test_constructors()
{
- bool test __attribute__((unused)) = true;
-
int x1=0,x2=0;
const int &z1=x1;
int
main()
{
- bool test __attribute__((unused)) = true;
-
int x1=0,x2=0;
const int &z1=x1;
// libstdc++/23978
void test01()
{
- bool test __attribute__((unused)) = true;
-
pair<int, int> p(1, 2);
int x = 0;
int y = 0;
void
check_tuple_cat(std::tuple<Args1...> t1, std::tuple<Args2...> t2)
{
- bool test __attribute__((unused)) = true;
-
typedef std::tuple<Args1..., Args2...> concatenated;
auto cat1 = std::tuple_cat( t1, t2 );
#include <tuple>
-bool test __attribute__((unused)) = true;
-
-
// make_tuple
void
test_make_tuple()
void
test01()
{
- bool test __attribute__((unused)) = true;
-
std::forward_as_tuple();
VERIFY( std::get<0>(std::forward_as_tuple(-1)) == -1 );
int
main()
{
- bool test __attribute__((unused)) = true;
-
int i=0;
make_tuple(1,2,4.0);
make_tuple(ref(i)) = tuple<int>(1);
int
main()
{
- bool test __attribute__((unused)) = true;
-
int x1 = 0;
int x2 = 0;
int y1 = 0;
int
main()
{
- bool test __attribute__((unused)) = true;
using namespace std;
int i;
void
test01()
{
- bool test __attribute__((unused)) = true;
using namespace std;
VERIFY( tuple_size<const tuple<> >::value == 0 );
int
main()
{
- bool test __attribute__((unused)) = true;
-
int j=1;
const int k=2;
tuple<int,int &,const int&> a(0,j,k);
int
main()
{
- bool test __attribute__((unused)) = true;
-
int j=1;
const int k=2;
tuple<int,int &,const int&> a(0,j,k);
int main()
{
- bool test __attribute__((unused)) = true;
-
std::tuple<int, double> a(1, 2.0), b;
b = std::move(a);
VERIFY( std::get<0>(b) == 1 && std::get<1>(b) == 2.0 );
void test01()
{
- bool test __attribute__((unused)) = true;
-
std::tuple<> t1, t2;
std::swap(t1, t2);
void test02()
{
- bool test __attribute__((unused)) = true;
-
std::tuple<int> t1(1), t2(2);
std::swap(t1, t2);
void test03()
{
- bool test __attribute__((unused)) = true;
-
std::tuple<int, float> t1(1, 1.0f), t2(2, 2.0f);
std::swap(t1, t2);
void test04()
{
- bool test __attribute__((unused)) = true;
-
std::tuple<int, float, MoveOnly>
t1(1, 1.0f, make_move_only(1)),
t2(2, 2.0f, make_move_only(2));
int
main()
{
- bool test __attribute__((unused)) = true;
-
static_assert(tuple_size<tuple<>>::value == 0, "");
static_assert(tuple_size<tuple<int>>::value == 1, "");
static_assert(tuple_size<tuple<void>>::value == 1, "");
void test01()
{
- bool test __attribute__((unused)) = true;
using namespace std;
class Abraca { };
void test01()
{
- bool test __attribute__((unused)) = true;
using namespace std;
class Abraca { };
void test01()
{
- bool test __attribute__((unused)) = true;
using namespace std;
class Abraca { };
void test01()
{
- bool test __attribute__((unused)) = true;
using namespace std;
class Abraca { };
Deleter&
operator=(const Deleter&)
{
- bool test __attribute__((unused)) = true;
VERIFY( true );
return *this;
}
Deleter&
operator=(Deleter&&)
{
- bool test __attribute__((unused)) = true;
VERIFY( false );
return *this;
}
void
test01()
{
- bool test __attribute__((unused)) = true;
-
D *d = new D;
std::unique_ptr<D> p1(d);
std::unique_ptr<D> p2(new D);
void
test01()
{
- bool test __attribute__((unused)) = true;
-
D *d = new D[3];
std::unique_ptr<D[]> p1(d);
std::unique_ptr<D[]> p2;
void
test01()
{
- bool test __attribute__((unused)) = true;
-
std::unique_ptr<A> p(new A);
p = nullptr;
void
test02()
{
- bool test __attribute__((unused)) = true;
-
std::unique_ptr<A[]> p(new A[2]);
p = nullptr;
void
test01()
{
- bool test __attribute__((unused)) = true;
-
std::auto_ptr<A> a(new A);
std::unique_ptr<A> a2(std::move(a));
VERIFY( a.get() == nullptr );
void
test01()
{
- bool test __attribute__((unused)) = true;
-
std::unique_ptr<A> p = nullptr;
VERIFY( p.get() == nullptr );
void
test02()
{
- bool test __attribute__((unused)) = true;
-
std::unique_ptr<A[]> p = nullptr;
VERIFY( p.get() == nullptr );
test01()
{
reset_count_struct __attribute__((unused)) reset;
- bool test __attribute__((unused)) = true;
std::unique_ptr<A> A_default;
VERIFY( A_default.get() == 0 );
test02()
{
reset_count_struct __attribute__((unused)) reset;
- bool test __attribute__((unused)) = true;
A * const A_default = 0;
std::unique_ptr<A> p1(A_default);
test01()
{
reset_count_struct __attribute__((unused)) reset;
- bool test __attribute__((unused)) = true;
std::unique_ptr<A[]> A_default;
VERIFY( A_default.get() == 0 );
void
test01()
{
- bool test __attribute__((unused)) = true;
count = 0;
{
std::unique_ptr<int, void(*)(int*)> p(nullptr, del);
void
test02()
{
- bool test __attribute__((unused)) = true;
count = 0;
{
std::unique_ptr<int[], void(*)(int*)> p(nullptr, vdel);
void
test01()
{
- bool test __attribute__((unused)) = true;
-
std::unique_ptr<A[]> a = std::make_unique<A[]>(3);
VERIFY( a != nullptr );
VERIFY( a[0].b && a[1].b && a[2].b );
void
test01()
{
- bool test __attribute__((unused)) = true;
-
int i = 0;
double d = 0;
char c = 0;
void test01()
{
- bool test __attribute__((unused)) = true;
-
struct T { };
std::unique_ptr<T> u0(new T);
void test01()
{
- bool test __attribute__((unused)) = true;
-
std::unique_ptr<int, D> up;
up.reset();
VERIFY( D::count == 0 );
void
test01()
{
- bool test __attribute__((unused)) = true;
-
std::unique_ptr<A> p1;
std::unique_ptr<A> p2;
void
test02()
{
- bool test __attribute__((unused)) = true;
-
std::unique_ptr<A> p1;
std::unique_ptr<A> p2(new A);
void
test01()
{
- bool test __attribute__((unused)) = true;
-
std::unique_ptr<A[]> p1;
std::unique_ptr<A[]> p2;
void
test02()
{
- bool test __attribute__((unused)) = true;
-
std::unique_ptr<A[]> p1;
std::unique_ptr<A[]> p2(new A[3]);
void
test01()
{
- bool test __attribute__((unused)) = true;
-
std::unique_ptr<A> p1;
std::unique_ptr<A> p2(new A);
std::unique_ptr<A> p3;
template<typename... T>
void test(T... args)
{
- bool test __attribute__((unused)) = true;
-
VERIFY( test2<CannotUse>(args...) );
VERIFY( test2<DoesNotUse>(args...) );
VERIFY( test2<UsesWithTag>(args...) );
void test01()
{
- bool test __attribute__((unused)) = true;
using std::uses_allocator;
using namespace __gnu_test;
void default_ctor()
{
- bool test [[gnu::unused]] = true;
-
variant<monostate, string> v;
VERIFY(holds_alternative<monostate>(v));
}
void copy_ctor()
{
- bool test [[gnu::unused]] = true;
-
variant<monostate, string> v("a");
VERIFY(holds_alternative<string>(v));
variant<monostate, string> u(v);
void move_ctor()
{
- bool test [[gnu::unused]] = true;
-
variant<monostate, string> v("a");
VERIFY(holds_alternative<string>(v));
variant<monostate, string> u(std::move(v));
void arbitrary_ctor()
{
- bool test [[gnu::unused]] = true;
-
variant<int, string> v("a");
VERIFY(holds_alternative<string>(v));
VERIFY(get<1>(v) == "a");
void copy_assign()
{
- bool test [[gnu::unused]] = true;
-
variant<monostate, string> v("a");
VERIFY(holds_alternative<string>(v));
variant<monostate, string> u;
void move_assign()
{
- bool test [[gnu::unused]] = true;
-
variant<monostate, string> v("a");
VERIFY(holds_alternative<string>(v));
variant<monostate, string> u;
void arbitrary_assign()
{
- bool test [[gnu::unused]] = true;
-
variant<int, string> v;
v = "a";
void dtor()
{
- bool test [[gnu::unused]] = true;
-
struct A {
A(int& called) : called(called) {}
~A() {
void in_place_index_ctor()
{
- bool test [[gnu::unused]] = true;
-
{
variant<int, string> v(in_place<1>, "a");
VERIFY(holds_alternative<string>(v));
void in_place_type_ctor()
{
- bool test [[gnu::unused]] = true;
-
{
variant<int, string> v(in_place<string>, "a");
VERIFY(holds_alternative<string>(v));
void uses_allocator_ctor()
{
- bool test [[gnu::unused]] = true;
-
std::allocator<char> a;
variant<UsesAllocatable> v(std::allocator_arg, a);
VERIFY(get<0>(v).d == 0);
void emplace()
{
- bool test [[gnu::unused]] = true;
-
variant<int, string> v;
v.emplace<0>(1);
VERIFY(get<0>(v) == 1);
void test_get()
{
- bool test [[gnu::unused]] = true;
-
VERIFY(get<1>(variant<int, string>("a")) == "a");
VERIFY(get<string>(variant<int, string>("a")) == "a");
{
void test_relational()
{
- bool test [[gnu::unused]] = true;
-
VERIFY((variant<int, string>(2) < variant<int, string>(3)));
VERIFY((variant<int, string>(3) == variant<int, string>(3)));
VERIFY((variant<int, string>(3) > variant<int, string>(2)));
void test_swap()
{
- bool test [[gnu::unused]] = true;
-
variant<int, string> a("a"), b("b");
a.swap(b);
VERIFY(get<1>(a) == "b");
void test_visit()
{
- bool test [[gnu::unused]] = true;
-
{
struct Visitor
{
void test_hash()
{
- bool test [[gnu::unused]] = true;
-
unordered_set<variant<int, string>> s;
VERIFY(s.emplace(3).second);
VERIFY(s.emplace("asdf").second);
void test_valueless_by_exception()
{
- bool test [[gnu::unused]] = true;
-
{
AlwaysThrow a;
bool caught = false;
int
test01()
{
- bool test __attribute__((unused)) = true;
-
// test empty weak_ptrs compare equivalent
std::weak_ptr<A> p1;
std::weak_ptr<B> p2;
int
test02()
{
- bool test __attribute__((unused)) = true;
-
std::shared_ptr<A> a0;
std::weak_ptr<A> w0(a0);
void test01()
{
- bool test __attribute__((unused)) = true;
typedef propagating_allocator<C, false> alloc_type;
typedef std::basic_string<C, traits, alloc_type> test_type;
test_type v1(alloc_type(1));
void test02()
{
- bool test __attribute__((unused)) = true;
typedef propagating_allocator<C, true> alloc_type;
typedef std::basic_string<C, traits, alloc_type> test_type;
test_type v1(alloc_type(1));
void test03()
{
- bool test __attribute__((unused)) = true;
typedef propagating_allocator<C, true> alloc_type;
typedef std::basic_string<C, traits, alloc_type> test_type;
test_type v1(alloc_type(1));
void test01()
{
- bool test __attribute__((unused)) = true;
typedef propagating_allocator<C, false> alloc_type;
typedef std::basic_string<C, traits, alloc_type> test_type;
test_type v1(alloc_type(1));
void test02()
{
- bool test __attribute__((unused)) = true;
typedef propagating_allocator<C, true> alloc_type;
typedef std::basic_string<C, traits, alloc_type> test_type;
test_type v1(alloc_type(1));
void test01()
{
- bool test __attribute__((unused)) = true;
typedef uneq_allocator<C> alloc_type;
typedef std::basic_string<C, traits, alloc_type> test_type;
test_type v1(alloc_type(1));
void test02()
{
- bool test __attribute__((unused)) = true;
typedef uneq_allocator<C> alloc_type;
typedef std::basic_string<C, traits, alloc_type> test_type;
test_type v1(alloc_type(1));
void test01()
{
- bool test __attribute__((unused)) = true;
typedef propagating_allocator<C, false> alloc_type;
typedef std::basic_string<C, traits, alloc_type> test_type;
void test02()
{
- bool test __attribute__((unused)) = true;
typedef propagating_allocator<C, true> alloc_type;
typedef std::basic_string<C, traits, alloc_type> test_type;
void test03()
{
- bool test __attribute__((unused)) = true;
typedef propagating_allocator<C, false> alloc_type;
typedef std::basic_string<C, traits, alloc_type> test_type;
void test01()
{
- bool test __attribute__((unused)) = true;
typedef propagating_allocator<C, false> alloc_type;
typedef std::basic_string<C, traits, alloc_type> test_type;
test_type v1(alloc_type(1));
void test02()
{
- bool test __attribute__((unused)) = true;
typedef propagating_allocator<C, true> alloc_type;
typedef std::basic_string<C, traits, alloc_type> test_type;
test_type v1(alloc_type(1));
void test01()
{
- bool test __attribute__((unused)) = true;
typedef propagating_allocator<C, false> alloc_type;
typedef std::basic_string<C, traits, alloc_type> test_type;
test_type v1(alloc_type(1));
void test02()
{
- bool test __attribute__((unused)) = true;
typedef propagating_allocator<C, true> alloc_type;
typedef std::basic_string<C, traits, alloc_type> test_type;
test_type v1(alloc_type(1));
void test03()
{
- bool test __attribute__((unused)) = true;
typedef propagating_allocator<C, true> alloc_type;
typedef std::basic_string<C, traits, alloc_type> test_type;
test_type v1(alloc_type(1));
void test01()
{
- bool test __attribute__((unused)) = true;
typedef propagating_allocator<C, false> alloc_type;
typedef std::basic_string<C, traits, alloc_type> test_type;
test_type v1(alloc_type(1));
void test02()
{
- bool test __attribute__((unused)) = true;
typedef propagating_allocator<C, true> alloc_type;
typedef std::basic_string<C, traits, alloc_type> test_type;
test_type v1(alloc_type(1));
void test01()
{
- bool test __attribute__((unused)) = true;
typedef uneq_allocator<C> alloc_type;
typedef std::basic_string<C, traits, alloc_type> test_type;
test_type v1(alloc_type(1));
void test02()
{
- bool test __attribute__((unused)) = true;
typedef uneq_allocator<C> alloc_type;
typedef std::basic_string<C, traits, alloc_type> test_type;
test_type v1(alloc_type(1));
void test01()
{
- bool test __attribute__((unused)) = true;
typedef propagating_allocator<C, false> alloc_type;
typedef std::basic_string<C, traits, alloc_type> test_type;
void test02()
{
- bool test __attribute__((unused)) = true;
typedef propagating_allocator<C, true> alloc_type;
typedef std::basic_string<C, traits, alloc_type> test_type;
void test03()
{
- bool test __attribute__((unused)) = true;
typedef propagating_allocator<C, false> alloc_type;
typedef std::basic_string<C, traits, alloc_type> test_type;
void test01()
{
- bool test __attribute__((unused)) = true;
typedef propagating_allocator<C, false> alloc_type;
typedef std::basic_string<C, traits, alloc_type> test_type;
test_type v1(alloc_type(1));
void test02()
{
- bool test __attribute__((unused)) = true;
typedef propagating_allocator<C, true> alloc_type;
typedef std::basic_string<C, traits, alloc_type> test_type;
test_type v1(alloc_type(1));
void test01()
{
- bool test __attribute__((unused)) = true;
-
// non POD types : resize, capacity, reserve
std::basic_string< A<B> > str02;
typedef std::basic_string< A<B> >::size_type size_type_o;
void test01()
{
// POD types : resize, capacity, reserve
- bool test __attribute__((unused)) = true;
std::string str01;
typedef std::string::size_type size_type_s;
void test01()
{
using namespace std;
- bool test __attribute__((unused)) = true;
typedef string::size_type size_type;
// http://gcc.gnu.org/ml/libstdc++/2001-11/msg00150.html
void test02()
{
- bool test __attribute__((unused)) = true;
-
std::string str01 = "twelve chars";
// str01 becomes shared
std::string str02 = str01;
// libstdc++/42573
void test01()
{
- bool test __attribute__((unused)) = true;
-
std::string s(100, 'a');
s.push_back('b');
s.push_back('b');
void test01()
{
// POD types : resize, capacity, reserve
- bool test __attribute__((unused)) = true;
std::wstring str01;
typedef std::wstring::size_type size_type_s;
void test01()
{
using namespace std;
- bool test __attribute__((unused)) = true;
typedef wstring::size_type size_type;
// http://gcc.gnu.org/ml/libstdc++/2001-11/msg00150.html
void test02()
{
- bool test __attribute__((unused)) = true;
-
std::wstring str01 = L"twelve chars";
// str01 becomes shared
std::wstring str02 = str01;
// libstdc++/42573
void test01()
{
- bool test __attribute__((unused)) = true;
-
std::wstring s(100, L'a');
s.push_back(L'b');
s.push_back(L'b');
void test01(void)
{
- bool test __attribute__((unused)) = true;
typedef std::string::size_type csize_type;
typedef std::string::iterator citerator;
csize_type npos = std::string::npos;
void test02()
{
- bool test __attribute__((unused)) = true;
-
// template<typename _InputIter>
// basic_string(_InputIter begin, _InputIter end, const allocator& a)
// where _InputIter is integral [21.3.1 para 15]
void test03()
{
- bool test __attribute__((unused)) = true;
const char* with_nulls = "This contains \0 a zero byte.";
// These are tests to see how basic_string handles data with NUL
// http://gcc.gnu.org/ml/libstdc++/2002-06/msg00025.html
void test04()
{
- bool test __attribute__((unused)) = true;
-
std::string str01("portofino");
std::string::reverse_iterator i1 = str01.rbegin();
// libstdc++/42261
void test01()
{
- bool test __attribute__((unused)) = true;
using namespace std;
const string s(string::size_type(6), string::size_type('f'));
// libstdc++/8347
void test05()
{
- bool test __attribute__((unused)) = true;
-
std::vector<char> empty;
std::string empty2(empty.begin(), empty.end());
void test01(int iter)
{
- bool test __attribute__((unused)) = true;
-
for (long i = 0, j = 1; i < iter; ++i, j *= 3)
{
istringstream isstr(data(j));
void test02()
{
- bool test __attribute__((unused)) = true;
-
std::string_view s("foo");
std::string s2(s);
void
test01()
{
- bool test __attribute__((unused)) = true;
-
using string = std::string;
using list = std::initializer_list<string::value_type>;
void test01()
{
- bool test __attribute__((unused)) = true;
-
std::string a, b;
a.push_back('1');
b = std::move(a);
void test01()
{
- bool test __attribute__((unused)) = true;
-
tstring a, b;
a.push_back('1');
b = std::move(a);
void test01(void)
{
- bool test __attribute__((unused)) = true;
typedef std::wstring::size_type csize_type;
typedef std::wstring::iterator citerator;
csize_type npos = std::wstring::npos;
void test02()
{
- bool test __attribute__((unused)) = true;
-
// template<typename _InputIter>
// basic_string(_InputIter begin, _InputIter end, const allocator& a)
// where _InputIter is integral [21.3.1 para 15]
void test03()
{
- bool test __attribute__((unused)) = true;
const wchar_t* with_nulls = L"This contains \0 a zero byte.";
// These are tests to see how basic_string handles data with NUL
// http://gcc.gnu.org/ml/libstdc++/2002-06/msg00025.html
void test04()
{
- bool test __attribute__((unused)) = true;
-
std::wstring str01(L"portofino");
std::wstring::reverse_iterator i1 = str01.rbegin();
// libstdc++/42261
void test01()
{
- bool test __attribute__((unused)) = true;
using namespace std;
const wstring s(wstring::size_type(6), wstring::size_type(L'f'));
// libstdc++/8347
void test05()
{
- bool test __attribute__((unused)) = true;
-
std::vector<wchar_t> empty;
std::wstring empty2(empty.begin(), empty.end());
void test01(int iter)
{
- bool test __attribute__((unused)) = true;
-
for (long i = 0, j = 1; i < iter; ++i, j *= 3)
{
wistringstream isstr(data(j));
void test02()
{
- bool test __attribute__((unused)) = true;
-
std::wstring_view s(L"foo");
std::wstring s2(s);
void
test01()
{
- bool test __attribute__((unused)) = true;
-
using string = std::wstring;
using list = std::initializer_list<string::value_type>;
void test01()
{
- bool test __attribute__((unused)) = true;
-
std::wstring a, b;
a.push_back(L'1');
b = std::move(a);
void test01()
{
- bool test __attribute__((unused)) = true;
-
twstring a, b;
a.push_back(L'1');
b = std::move(a);
#include <stdexcept>
#include <testsuite_hooks.h>
-bool test01(void)
+void test01(void)
{
- bool test __attribute__((unused)) = true;
typedef std::string::size_type csize_type;
typedef std::string::const_reference cref;
typedef std::string::reference ref;
catch(...) {
VERIFY( false );
}
- return test;
}
int main()
// Do a quick sanity check on known problems with element access and
// ref-counted strings. These should all pass, regardless of the
// underlying string implementation, of course.
-bool test01(void)
+void test01(void)
{
- bool test __attribute__((unused)) = true;
typedef std::string::size_type csize_type;
typedef std::string::iterator siterator;
typedef std::string::reverse_iterator sriterator;
VERIFY( str03[0] == 'x' );
// need to also test for const begin/const end
- return test;
}
int main()
// Do another sanity check, this time for member functions that return
// iterators, namely insert and erase.
-bool test02(void)
+void test02(void)
{
- bool test __attribute__((unused)) = true;
typedef std::string::size_type csize_type;
typedef std::string::iterator siterator;
typedef std::string::reverse_iterator sriterator;
std::string str13 = str12;
*p2 = 'e';
VERIFY( str12 != str13 );
- return test;
}
int main()
// http://gcc.gnu.org/ml/libstdc++/2004-01/msg00184.html
void test01()
{
- bool test __attribute__((unused)) = true;
using namespace std;
for (int i = 0; i < 2000; ++i)
// PR c++/58163
void test01()
{
- bool test __attribute__((unused)) = true;
-
const std::string cs;
std::string s;
// as per 21.3.4
int main()
{
- bool test __attribute__((unused)) = true;
-
{
std::string empty;
char c = empty[0];
void test01()
{
- bool test __attribute__((unused)) = true;
-
std::string str("ramifications");
const std::string cstr("melodien");
#include <stdexcept>
#include <testsuite_hooks.h>
-bool test01(void)
+void test01(void)
{
- bool test __attribute__((unused)) = true;
typedef std::wstring::size_type csize_type;
typedef std::wstring::const_reference cref;
typedef std::wstring::reference ref;
catch(...) {
VERIFY( false );
}
- return test;
}
int main()
// Do a quick sanity check on known problems with element access and
// ref-counted strings. These should all pass, regardless of the
// underlying string implementation, of course.
-bool test01(void)
+void test01(void)
{
- bool test __attribute__((unused)) = true;
typedef std::wstring::size_type csize_type;
typedef std::wstring::iterator siterator;
typedef std::wstring::reverse_iterator sriterator;
VERIFY( str03[0] == L'x' );
// need to also test for const begin/const end
- VERIFY(test);
- return test;
}
int main()
// Do another sanity check, this time for member functions that return
// iterators, namely insert and erase.
-bool test02(void)
+void test02(void)
{
- bool test __attribute__((unused)) = true;
typedef std::wstring::size_type csize_type;
typedef std::wstring::iterator siterator;
typedef std::wstring::reverse_iterator sriterator;
std::wstring str13 = str12;
*p2 = L'e';
VERIFY( str12 != str13 );
- return test;
}
int main()
// http://gcc.gnu.org/ml/libstdc++/2004-01/msg00184.html
void test01()
{
- bool test __attribute__((unused)) = true;
using namespace std;
for (int i = 0; i < 2000; ++i)
// PR c++/58163
void test01()
{
- bool test __attribute__((unused)) = true;
-
const std::wstring cs;
std::wstring s;
// as per 21.3.4
int main()
{
- bool test __attribute__((unused)) = true;
-
{
std::wstring empty;
wchar_t c = empty[0];
void test01()
{
- bool test __attribute__((unused)) = true;
-
std::wstring str(L"ramifications");
const std::wstring cstr(L"melodien");
using namespace std;
-int test01(void)
+void test01(void)
{
- bool test = true;
-
string s1 = { 'a', 'b', 'c' };
VERIFY(s1 == "abc");
i2 = i1+6;
s1.replace(i1, i2, { 'y', 'z' });
VERIFY(s1 == "mnyzo");
-
- return test;
}
int main()
#include <iostream>
#include <testsuite_hooks.h>
-bool test01(void)
+void test01(void)
{
- bool test __attribute__((unused)) = true;
typedef std::string::size_type csize_type;
typedef std::string::const_reference cref;
typedef std::string::reference ref;
std::string hello_world;
std::cout << hello_world;
- return test;
}
int main()
void check(istream& stream, const string& str, unsigned nchunks, char delim)
{
- bool test __attribute__((unused)) = true;
-
string chunk;
string::size_type index = 0, index_new = 0;
unsigned n = 0;
void check(istream& stream, const string& str, unsigned nchunks)
{
- bool test __attribute__((unused)) = true;
-
string chunk;
string::size_type index = 0, index_new = 0;
unsigned n = 0;
void test01()
{
using namespace std;
- bool test __attribute__((unused)) = true;
ostringstream oss_01;
const string str_01(50, 'a');
// based on a bug report libstdc++ 9
void test04(std::size_t size)
{
- bool test __attribute__((unused)) = true;
std::string str(size, 's');
std::size_t expected_size = 2 * (size + 1);
std::ostringstream oss(str);
// stress test
oss << str << std::endl;
if (!oss.good())
- test = false;
+ VERIFY( false );
oss << str << std::endl;
if (!oss.good())
- test = false;
+ VERIFY( false );
VERIFY( str.size() == size );
VERIFY( oss.good() );
// mode == out
void test05(std::size_t size)
{
- bool test __attribute__((unused)) = true;
+ bool test = true;
const char filename[] = "inserters_extractors-1.txt";
const char fillc = 'f';
std::ofstream ofs(filename);
// http://gcc.gnu.org/ml/libstdc++/1999-q4/msg00049.html
void test06(void)
{
- bool test __attribute__((unused)) = true;
-
typedef std::string::size_type size_type;
std::string str01("@silent");
size_type i01 = str01.size();
// NB: this is a defect in the standard.
void test07(void)
{
- bool test __attribute__((unused)) = true;
const std::string name("z6.cc");
std::istringstream iss (name);
int i = 0;
{
using namespace std;
- bool test __attribute__((unused)) = true;
istringstream istrm("enero:2001");
int year;
char sep;
// libstdc++/2830
void test09()
{
- bool test __attribute__((unused)) = true;
std::string blanks( 3, '\0');
std::string foo = "peace";
foo += blanks;
typedef basic_stringbuf<pod_ushort> stringbuf_type;
typedef basic_istream<pod_ushort> istream_type;
- bool test __attribute__((unused)) = true;
-
string_type str;
stringbuf_type strbuf01;
istream_type stream(&strbuf01);
typedef basic_stringbuf<pod_ushort> stringbuf_type;
typedef basic_ostream<pod_ushort> ostream_type;
- bool test __attribute__((unused)) = true;
-
string_type str;
stringbuf_type strbuf01;
ostream_type stream(&strbuf01);
#include <iostream>
#include <testsuite_hooks.h>
-bool test01(void)
+void test01(void)
{
- bool test __attribute__((unused)) = true;
typedef std::wstring::size_type csize_type;
typedef std::wstring::const_reference cref;
typedef std::wstring::reference ref;
std::wstring hello_world;
std::wcout << hello_world;
- return test;
}
int main()
void check(wistream& stream, const wstring& str, unsigned nchunks, wchar_t delim)
{
- bool test __attribute__((unused)) = true;
-
wstring chunk;
wstring::size_type index = 0, index_new = 0;
unsigned n = 0;
void check(wistream& stream, const wstring& str, unsigned nchunks)
{
- bool test __attribute__((unused)) = true;
-
wstring chunk;
wstring::size_type index = 0, index_new = 0;
unsigned n = 0;
void test01()
{
using namespace std;
- bool test __attribute__((unused)) = true;
wostringstream oss_01;
const wstring str_01(50, L'a');
// based on a bug report libstdc++ 9
void test04(std::size_t size)
{
- bool test __attribute__((unused)) = true;
std::wstring str(size, L's');
std::size_t expected_size = 2 * (size + 1);
std::wostringstream oss(str);
// stress test
oss << str << std::endl;
if (!oss.good())
- test = false;
+ VERIFY( false );
oss << str << std::endl;
if (!oss.good())
- test = false;
+ VERIFY( false );
VERIFY( str.size() == size );
VERIFY( oss.good() );
// mode == out
void test05(std::size_t size)
{
- bool test __attribute__((unused)) = true;
+ bool test = true;
const char filename[] = "inserters_extractors-1.txt";
const wchar_t fillc = L'f';
std::wofstream ofs(filename);
// http://gcc.gnu.org/ml/libstdc++/1999-q4/msg00049.html
void test06(void)
{
- bool test __attribute__((unused)) = true;
-
typedef std::wstring::size_type size_type;
std::wstring str01(L"@silent");
size_type i01 = str01.size();
// NB: this is a defect in the standard.
void test07(void)
{
- bool test __attribute__((unused)) = true;
const std::wstring name(L"z6.cc");
std::wistringstream iss(name);
int i = 0;
{
using namespace std;
- bool test __attribute__((unused)) = true;
wistringstream istrm(L"enero:2001");
int year;
wchar_t sep;
// libstdc++/2830
void test09()
{
- bool test __attribute__((unused)) = true;
std::wstring blanks(3, L'\0');
std::wstring foo = L"peace";
foo += blanks;
#include <stdexcept>
#include <testsuite_hooks.h>
-bool test01(void)
+void test01(void)
{
- bool test __attribute__((unused)) = true;
typedef std::string::size_type csize_type;
typedef std::string::const_reference cref;
typedef std::string::reference ref;
str05.append(str05.begin(), str05.begin() + str05.find('r'));
VERIFY( str05 == "point bolivar, texaspoint boliva" );
VERIFY( str05 != str01 );
- return test;
}
int main()
void
test02()
{
- bool test __attribute__((unused)) = true;
-
using namespace std;
string one;
void
test03()
{
- bool test __attribute__((unused)) = true;
-
using namespace std;
const char * source = "Kesto";
void
test03()
{
- bool test __attribute__((unused)) = true;
std::string_view str1("foo");
std::string str2;
str2 += str1;
void
test04()
{
- bool test __attribute__((unused)) = true;
-
std::string str("a");
char c = 'b';
str.append(&c, 1);
#include <stdexcept>
#include <testsuite_hooks.h>
-bool test01(void)
+void test01(void)
{
- bool test __attribute__((unused)) = true;
typedef std::wstring::size_type csize_type;
typedef std::wstring::const_reference cref;
typedef std::wstring::reference ref;
str05.append(str05.begin(), str05.begin() + str05.find(L'r'));
VERIFY( str05 == L"point bolivar, texaspoint boliva" );
VERIFY( str05 != str01 );
- return test;
}
int main()
void
test02()
{
- bool test __attribute__((unused)) = true;
-
using namespace std;
wstring one;
void
test03()
{
- bool test __attribute__((unused)) = true;
-
using namespace std;
const wchar_t * source = L"Kesto";
void
test03()
{
- bool test __attribute__((unused)) = true;
std::wstring_view str1(L"foo");
std::wstring str2;
str2 += str1;
void
test04()
{
- bool test __attribute__((unused)) = true;
-
std::wstring str(L"a");
wchar_t c = L'b';
void
test01()
{
- bool test __attribute__((unused)) = true;
-
using namespace std;
const char* strlit = "../the long pier/Hanalei Bay/Kauai/Hawaii";
void
test02()
{
- bool test __attribute__((unused)) = true;
-
using namespace std;
string one = "Selling England by the pound";
void
test03()
{
- bool test __attribute__((unused)) = true;
-
using namespace std;
string one;
void
test03()
{
- bool test __attribute__((unused)) = true;
std::string_view str1("foo");
std::string str2;
str2.assign(str1);
void
test04()
{
- bool test __attribute__((unused)) = true;
-
std::string str("a");
char c = 'b';
str.assign(&c, 1);
void test01()
{
- bool test __attribute__((unused)) = true;
-
std::string a, b;
a.push_back('1');
b.assign(std::move(a));
void
test01()
{
- bool test __attribute__((unused)) = true;
-
using namespace std;
const wchar_t* strlit = L"../the long pier/Hanalei Bay/Kauai/Hawaii";
void
test02()
{
- bool test __attribute__((unused)) = true;
-
using namespace std;
wstring one = L"Selling England by the pound";
void
test03()
{
- bool test __attribute__((unused)) = true;
-
using namespace std;
wstring one;
void
test03()
{
- bool test __attribute__((unused)) = true;
std::wstring_view str1(L"foo");
std::wstring str2;
str2.assign(str1);
void
test04()
{
- bool test __attribute__((unused)) = true;
-
std::wstring str(L"a");
wchar_t c = L'b';
void test01()
{
- bool test __attribute__((unused)) = true;
-
std::wstring a, b;
a.push_back(L'1');
b.assign(std::move(a));
#include <stdexcept>
#include <testsuite_hooks.h>
-int test01(void)
+void test01(void)
{
- bool test __attribute__((unused)) = true;
typedef std::string::size_type csize_type;
typedef std::string::iterator citerator;
csize_type csz01, csz02;
csz01 = str03.size();
str03.insert(str03.end(), str01.begin(), str01.end());
VERIFY( str03 == "baker beach, san franciscorodeo beach, marin" );
- return test;
}
int main()
// string& insert(size_type __p, const char* s, size_type n);
// string& insert(size_type __p, const char* s);
// but now s points inside the _Rep
-int test02(void)
+void test02(void)
{
- bool test __attribute__((unused)) = true;
-
std::string str01;
const char* title = "Everything was beautiful, and nothing hurt";
// Increasing size: str01 is reallocated every time.
str01.insert(0, str01.c_str());
VERIFY( str01 == "Everything was beautiful, and nothing hurt"
"Everything was beautiful, and nothing hurt");
- return test;
}
int main()
void
test03()
{
- bool test __attribute__((unused)) = true;
std::string_view str1("foo");
std::string str2;
str2.insert(0, str1);
void
test04()
{
- bool test __attribute__((unused)) = true;
-
std::string str("a");
char c = 'b';
str.insert(0, &c, 1);
#include <stdexcept>
#include <testsuite_hooks.h>
-int test01(void)
+void test01(void)
{
- bool test __attribute__((unused)) = true;
typedef std::wstring::size_type csize_type;
typedef std::wstring::iterator citerator;
csize_type csz01, csz02;
csz01 = str03.size();
str03.insert(str03.end(), str01.begin(), str01.end());
VERIFY( str03 == L"baker beach, san franciscorodeo beach, marin" );
- return test;
}
int main()
// wstring& insert(size_type __p, const wchar_t* s, size_type n);
// wstring& insert(size_type __p, const wchar_t* s);
// but now s points inside the _Rep
-int test02(void)
+void test02(void)
{
- bool test __attribute__((unused)) = true;
-
std::wstring str01;
const wchar_t* title = L"Everything was beautiful, and nothing hurt";
// Increasing size: str01 is reallocated every time.
str01.insert(0, str01.c_str());
VERIFY( str01 == L"Everything was beautiful, and nothing hurt"
L"Everything was beautiful, and nothing hurt");
- return test;
}
int main()
void
test03()
{
- bool test __attribute__((unused)) = true;
std::wstring_view str1(L"foo");
std::wstring str2;
str2.insert(0, str1);
void
test04()
{
- bool test __attribute__((unused)) = true;
-
std::wstring str(L"a");
wchar_t c = L'b';
void test01()
{
- bool test __attribute__((unused)) = true;
-
const std::string cstr("Badger");
std::string str = cstr;
str.pop_back();
void test01()
{
- bool test __attribute__((unused)) = true;
-
const std::wstring cstr(L"Badger");
std::wstring str = cstr;
str.pop_back();
#include <algorithm> // for std::find
#include <testsuite_hooks.h>
-bool test01(void)
+void test01(void)
{
- bool test __attribute__((unused)) = true;
typedef std::string::size_type csize_type;
typedef std::string::const_reference cref;
typedef std::string::reference ref;
std::find(x.rbegin(), x.rend(), 'l').base(), ar,
ar + sizeof(ar) / sizeof(ar[0]));
VERIFY( x == "jeHelloo" );
- return test;
}
int main()
void
test02()
{
- bool test __attribute__((unused)) = true;
const char* strlit = "../the long pier/Hanalei Bay/Kauai/Hawaii";
std::string aux = strlit;
aux.replace(aux.begin()+5, aux.begin()+20,
void
test03()
{
- bool test __attribute__((unused)) = true;
const char* title01 = "nine types of ambiguity";
const char* title02 = "ultra";
std::string str01 = title01;
void
test04()
{
- bool test __attribute__((unused)) = true;
std::string str01 = "geogaddi";
std::string str02;
void
test05()
{
- bool test __attribute__((unused)) = true;
std::string str01 = "londinium";
std::string str02 = "cydonia";
void test01()
{
- bool test __attribute__((unused)) = true;
-
std::string str01("Valle Del Salto");
str01.replace(0, 5, str01.data() + 10, 5);
VERIFY( str01 == "Salto Del Salto" );
void
test03()
{
- bool test __attribute__((unused)) = true;
std::string_view str1("foo");
std::string str2("bar");
str2.replace(0, 3, str1);
void
test04()
{
- bool test __attribute__((unused)) = true;
-
std::string str("a");
char c = 'b';
str.replace(0, 1, &c, 1);
#include <algorithm> // for std::find
#include <testsuite_hooks.h>
-bool test01(void)
+void test01(void)
{
- bool test __attribute__((unused)) = true;
typedef std::wstring::size_type csize_type;
typedef std::wstring::const_reference cref;
typedef std::wstring::reference ref;
std::find(x.rbegin(), x.rend(), L'l').base(), ar,
ar + sizeof(ar) / sizeof(ar[0]));
VERIFY( x == L"jeHelloo" );
- return test;
}
int main()
void
test02()
{
- bool test __attribute__((unused)) = true;
const wchar_t* strlit = L"../the long pier/Hanalei Bay/Kauai/Hawaii";
std::wstring aux = strlit;
aux.replace(aux.begin()+5, aux.begin()+20,
void
test03()
{
- bool test __attribute__((unused)) = true;
const wchar_t* title01 = L"nine types of ambiguity";
const wchar_t* title02 = L"ultra";
std::wstring str01 = title01;
void
test04()
{
- bool test __attribute__((unused)) = true;
std::wstring str01 = L"geogaddi";
std::wstring str02;
void
test05()
{
- bool test __attribute__((unused)) = true;
std::wstring str01 = L"londinium";
std::wstring str02 = L"cydonia";
void test01()
{
- bool test __attribute__((unused)) = true;
-
std::wstring str01(L"Valle Del Salto");
str01.replace(0, 5, str01.data() + 10, 5);
VERIFY( str01 == L"Salto Del Salto" );
void
test03()
{
- bool test __attribute__((unused)) = true;
std::wstring_view str1(L"foo");
std::wstring str2(L"bar");
str2.replace(0, 3, str1);
void
test04()
{
- bool test __attribute__((unused)) = true;
-
std::wstring str(L"a");
wchar_t c = L'b';
// DR 1261. Insufficient overloads for to_string / to_wstring
void test01()
{
- bool test __attribute__((unused)) = true;
using namespace std;
const string one(to_string(-2));
void
test01()
{
- bool test __attribute__((unused)) = false;
+ bool test = false;
+
using namespace std;
try
void
test01()
{
- bool test __attribute__((unused)) = false;
+ bool test = false;
using namespace std;
try
void
test01()
{
- bool test __attribute__((unused)) = false;
+ bool test = false;
using namespace std;
try
void
test01()
{
- bool test __attribute__((unused)) = false;
+ bool test = false;
using namespace std;
try
void
test01()
{
- bool test __attribute__((unused)) = false;
+ bool test = false;
using namespace std;
try
void
test01()
{
- bool test __attribute__((unused)) = false;
+ bool test = false;
using namespace std;
try
void
test01()
{
- bool test __attribute__((unused)) = false;
+ bool test = false;
using namespace std;
try
void
test01()
{
- bool test __attribute__((unused)) = false;
+ bool test = false;
using namespace std;
try
void
test01()
{
- bool test __attribute__((unused)) = true;
+ bool test = true;
using namespace std;
long long ll1 = -2;
// DR 1261. Insufficient overloads for to_string / to_wstring
void test01()
{
- bool test __attribute__((unused)) = true;
using namespace std;
const wstring one(to_wstring(-2));
{
#if _GLIBCXX_USE_C99_WCHAR
- bool test __attribute__((unused)) = false;
+ bool test = false;
using namespace std;
try
{
#if _GLIBCXX_USE_C99_WCHAR
- bool test __attribute__((unused)) = false;
+ bool test = false;
using namespace std;
try
{
#if _GLIBCXX_USE_C99_WCHAR
- bool test __attribute__((unused)) = false;
+ bool test = false;
using namespace std;
try
{
#if _GLIBCXX_USE_C99_WCHAR
- bool test __attribute__((unused)) = false;
+ bool test = false;
using namespace std;
try
{
#if _GLIBCXX_USE_C99_WCHAR
- bool test __attribute__((unused)) = false;
+ bool test = false;
using namespace std;
try
{
#if _GLIBCXX_USE_C99_WCHAR
- bool test __attribute__((unused)) = false;
+ bool test = false;
using namespace std;
try
{
#if _GLIBCXX_USE_C99_WCHAR
- bool test __attribute__((unused)) = false;
+ bool test = false;
using namespace std;
try
{
#if _GLIBCXX_USE_C99_WCHAR
- bool test __attribute__((unused)) = false;
+ bool test = false;
using namespace std;
try
{
#if _GLIBCXX_USE_C99_WCHAR
- bool test __attribute__((unused)) = true;
using namespace std;
long long ll1 = -2;
int
test_value(int result, want_value expected)
{
- bool test __attribute__((unused)) = true;
bool pass = false;
switch (expected) {
void test01()
{
using namespace std;
- bool test __attribute__((unused)) = true;
const char lit_01[] = { 'w', 'e', '\0', 'r', 'd' };
const char lit_02[] = { 'w', 'e', 'i', '\0', 'd' };
void
test03()
{
- bool test __attribute__((unused)) = true;
std::string_view str1("foobar");
std::string str2("foobar");
void
test04()
{
- bool test __attribute__((unused)) = true;
-
const std::string str("a");
char c = 'a';
int res = str.compare(0, 1, &c, 1);
int
test_value(int result, want_value expected)
{
- bool test __attribute__((unused)) = true;
bool pass = false;
switch (expected) {
void test01()
{
using namespace std;
- bool test __attribute__((unused)) = true;
const wchar_t lit_01[] = { L'w', L'e', L'\0', L'r', L'd' };
const wchar_t lit_02[] = { L'w', L'e', L'i', L'\0', L'd' };
void
test03()
{
- bool test __attribute__((unused)) = true;
std::wstring_view str1(L"foobar");
std::wstring str2(L"foobar");
void
test04()
{
- bool test __attribute__((unused)) = true;
-
const std::wstring str(L"a");
wchar_t c = L'a';
int test01(void)
{
- bool test __attribute__((unused)) = true;
-
std::string empty;
// data() for size == 0 is non-NULL.
int test01(void)
{
- bool test __attribute__((unused)) = true;
-
std::wstring empty;
// data() for size == 0 is non-NULL.
#include <string>
#include <testsuite_hooks.h>
-bool test01(void)
+void test01(void)
{
- bool test __attribute__((unused)) = true;
typedef std::string::size_type csize_type;
typedef std::string::const_reference cref;
typedef std::string::reference ref;
VERIFY( csz01 == csz02 );
csz01 = str01.find('/');
VERIFY( csz01 == npos );
- return test;
}
int main()
#include <string>
#include <testsuite_hooks.h>
-bool test02(void)
+void test02(void)
{
- bool test __attribute__((unused)) = true;
typedef std::string::size_type csize_type;
csize_type npos = std::string::npos;
csize_type csz01, csz02;
csz01 = str01.find_first_of('z');
csz02 = str01.size() - 1;
VERIFY( csz01 == csz02 );
- return test;
}
int main()
#include <string>
#include <testsuite_hooks.h>
-bool test03(void)
+void test03(void)
{
- bool test __attribute__((unused)) = true;
typedef std::string::size_type csize_type;
csize_type npos = std::string::npos;
csize_type csz01;
VERIFY( csz01 == 0 );
csz01 = str04.find_first_not_of('S');
VERIFY( csz01 == npos );
- return test;
}
int main()
// libstdc++/31401
void test01()
{
- bool test __attribute__((unused)) = true;
typedef std::string::size_type csize_type;
csize_type npos = std::string::npos;
void
test03()
{
- bool test __attribute__((unused)) = true;
std::string_view str1("bar");
std::string str2("foobar");
#include <string>
#include <testsuite_hooks.h>
-bool test01(void)
+void test01(void)
{
- bool test __attribute__((unused)) = true;
typedef std::wstring::size_type csize_type;
typedef std::wstring::const_reference cref;
typedef std::wstring::reference ref;
VERIFY( csz01 == csz02 );
csz01 = str01.find(L'/');
VERIFY( csz01 == npos );
- return test;
}
int main()
#include <string>
#include <testsuite_hooks.h>
-bool test02(void)
+void test02(void)
{
- bool test __attribute__((unused)) = true;
typedef std::wstring::size_type csize_type;
csize_type npos = std::wstring::npos;
csize_type csz01, csz02;
csz01 = str01.find_first_of(L'z');
csz02 = str01.size() - 1;
VERIFY( csz01 == csz02 );
- return test;
}
int main()
#include <string>
#include <testsuite_hooks.h>
-bool test03(void)
+void test03(void)
{
- bool test __attribute__((unused)) = true;
typedef std::wstring::size_type csize_type;
csize_type npos = std::wstring::npos;
csize_type csz01;
VERIFY( csz01 == 0 );
csz01 = str04.find_first_not_of(L'S');
VERIFY( csz01 == npos );
- return test;
}
int main()
// libstdc++/31401
void test01()
{
- bool test __attribute__((unused)) = true;
typedef std::wstring::size_type csize_type;
csize_type npos = std::wstring::npos;
void
test03()
{
- bool test __attribute__((unused)) = true;
std::wstring_view str1(L"bar");
std::wstring str2(L"foobar");
#include <testsuite_hooks.h>
// 21.3.6.2 basic_string rfind
-bool test01(void)
+void test01(void)
{
- bool test __attribute__((unused)) = true;
typedef std::string::size_type csize_type;
typedef std::string::const_reference cref;
typedef std::string::reference ref;
VERIFY( csz01 == csz02 );
csz01 = str01.rfind('/');
VERIFY( csz01 == npos );
- return test;
}
int main()
#include <testsuite_hooks.h>
// 21.3.6.4 basic_string::find_last_of
-bool test02()
+void test02()
{
- bool test __attribute__((unused)) = true;
std::string z("ab");
std::string::size_type pos;
pos = z.find_last_of("ab");
VERIFY( pos == 1 );
pos = z.find_last_of('X');
VERIFY( pos == std::string::npos );
- return test;
}
int main()
#include <testsuite_hooks.h>
// 21.3.6.6 basic_string::find_last_not_of
-bool test03()
+void test03()
{
- bool test __attribute__((unused)) = true;
typedef std::string::size_type csize_type;
std::string::size_type pos;
csize_type npos = std::string::npos;
VERIFY( pos == 0 );
pos = z.find_last_not_of("Xa");
VERIFY( pos == 1 );
- return test;
}
int main()
{
#include <testsuite_hooks.h>
// 21.3.6.2 basic_string rfind
-bool test01(void)
+void test01(void)
{
- bool test __attribute__((unused)) = true;
typedef std::wstring::size_type csize_type;
typedef std::wstring::const_reference cref;
typedef std::wstring::reference ref;
VERIFY( csz01 == csz02 );
csz01 = str01.rfind(L'/');
VERIFY( csz01 == npos );
- return test;
}
int main()
#include <testsuite_hooks.h>
// 21.3.6.4 basic_string::find_last_of
-bool test02()
+void test02()
{
- bool test __attribute__((unused)) = true;
std::wstring::size_type pos;
std::wstring z(L"ab");
pos = z.find_last_of(L"ab");
VERIFY( pos == 1 );
pos = z.find_last_of(L'X');
VERIFY( pos == std::wstring::npos );
- return test;
}
int main()
#include <testsuite_hooks.h>
// 21.3.6.6 basic_string::find_last_not_of
-bool test03()
+void test03()
{
- bool test __attribute__((unused)) = true;
typedef std::wstring::size_type csize_type;
std::wstring::size_type pos;
csize_type npos = std::wstring::npos;
VERIFY( pos == 0 );
pos = z.find_last_not_of(L"Xa");
VERIFY( pos == 1 );
- return test;
}
int main()
{
#include <stdexcept>
#include <testsuite_hooks.h>
-bool test01(void)
+void test01(void)
{
- bool test __attribute__((unused)) = true;
typedef std::string::size_type csize_type;
typedef std::string::const_reference cref;
typedef std::string::reference ref;
catch(...) {
VERIFY( false );
}
- return test;
}
int main()
#include <stdexcept>
#include <testsuite_hooks.h>
-bool test01(void)
+void test01(void)
{
- bool test __attribute__((unused)) = true;
typedef std::wstring::size_type csize_type;
typedef std::wstring::const_reference cref;
typedef std::wstring::reference ref;
catch(...) {
VERIFY( false );
}
- return test;
}
int main()
int test01(void)
{
- bool test __attribute__((unused)) = true;
-
std::string str1;
std::string str2;
int test01(void)
{
- bool test __attribute__((unused)) = true;
std::string str_0("costa rica");
std::string str_1("costa marbella");
std::string str_2("cost");
void test01()
{
- bool test __attribute__((unused)) = true;
using std::string;
VERIFY( (string("abc") + string("def")
void test01()
{
- bool test __attribute__((unused)) = true;
using std::string;
using std::move;
int test01(void)
{
- bool test __attribute__((unused)) = true;
-
std::string_view str1("foo");;
std::string str2;
int test01(void)
{
- bool test __attribute__((unused)) = true;
-
std::wstring str1;
std::wstring str2;
int test01(void)
{
- bool test __attribute__((unused)) = true;
std::wstring str_0(L"costa rica");
std::wstring str_1(L"costa marbella");
std::wstring str_2(L"cost");
void test01()
{
- bool test __attribute__((unused)) = true;
using std::wstring;
VERIFY( (wstring(L"abc") + wstring(L"def")
void test01()
{
- bool test __attribute__((unused)) = true;
using std::wstring;
using std::move;
int test01(void)
{
- bool test __attribute__((unused)) = true;
-
std::wstring_view str1(L"foo");;
std::wstring str2;
void
test01()
{
- bool test [[gnu::unused]] = true;
-
std::basic_string_view<A<B>> str02;
typedef std::basic_string_view< A<B> >::size_type size_type_o;
size_type_o sz03;
void
test01()
{
- bool test [[gnu::unused]] = true;
typedef std::string_view::size_type csize_type;
// basic_string_view()
void
test03()
{
- bool test [[gnu::unused]] = true;
const char* with_nulls = "This contains \0 a zero byte.";
// These are tests to see how basic_string_view handles data with NUL
void
test05()
{
- bool test [[gnu::unused]] = true;
-
char const * s = 0;
std::string_view zero_length_built_with_NULL(s, 0);
}
void
test01()
{
- bool test [[gnu::unused]] = true;
typedef std::wstring_view::size_type csize_type;
// basic_string_view()
void
test03()
{
- bool test [[gnu::unused]] = true;
const wchar_t* with_nulls = L"This contains \0 a zero byte.";
// These are tests to see how basic_string_view handles data with NUL
void
test05()
{
- bool test [[gnu::unused]] = true;
-
wchar_t const * s = 0;
std::wstring_view zero_length_built_with_NULL(s, 0);
}
#include <stdexcept>
#include <testsuite_hooks.h>
-bool
+void
test01()
{
- bool test [[gnu::unused]] = true;
-
typedef std::string_view::size_type csize_type;
typedef std::string_view::const_reference cref;
typedef std::string_view::reference ref;
{
VERIFY( false );
}
-
- return test;
}
int
int
main()
{
- bool test [[gnu::unused]] = true;
-
{
std::string_view empty;
VERIFY( empty.empty() );
void
test01()
{
- bool test [[gnu::unused]] = true;
-
std::string_view str("ramifications");
const std::string_view cstr("melodien");
#include <stdexcept>
#include <testsuite_hooks.h>
-bool
+void
test01()
{
- bool test [[gnu::unused]] = true;
-
typedef std::wstring_view::size_type csize_type;
typedef std::wstring_view::const_reference cref;
typedef std::wstring_view::reference ref;
{
VERIFY( false );
}
-
- return test;
}
int
int
main()
{
- bool test [[gnu::unused]] = true;
-
{
std::wstring_view empty;
VERIFY( empty.empty() );
void
test01()
{
- bool test [[gnu::unused]] = true;
-
std::wstring_view str(L"ramifications");
const std::wstring_view cstr(L"melodien");
#include <iostream>
#include <testsuite_hooks.h>
-bool
+void
test01()
{
- bool test [[gnu::unused]] = true;
-
typedef std::string_view::size_type csize_type;
typedef std::string_view::const_reference cref;
typedef std::string_view::reference ref;
std::string_view hello_world;
std::cout << hello_world;
-
- return test;
}
int
void
test05(std::size_t size)
{
- bool test [[gnu::unused]] = true;
+ bool test = true;
const char filename[] = "inserters_extractors-2.txt";
const char fillc = 'f';
void
test09()
{
- bool test [[gnu::unused]] = true;
-
std::string_view foo{"peace\0\0\0& love"};
std::ostringstream oss1;
typedef basic_stringbuf<pod_ushort> stringbuf_type;
typedef basic_ostream<pod_ushort> ostream_type;
- bool test [[gnu::unused]] = true;
-
string_type str;
stringbuf_type strbuf01;
ostream_type stream(&strbuf01);
#include <iostream>
#include <testsuite_hooks.h>
-bool
+void
test01()
{
- bool test [[gnu::unused]] = true;
-
typedef std::wstring_view::size_type csize_type;
typedef std::wstring_view::const_reference cref;
typedef std::wstring_view::reference ref;
std::wstring_view hello_world;
std::wcout << hello_world;
-
- return test;
}
int
void
test05(std::size_t size)
{
- bool test [[gnu::unused]] = true;
+ bool test = true;
const char filename[] = "inserters_extractors-2.txt";
const wchar_t fillc = L'f';
void
test09()
{
- bool test [[gnu::unused]] = true;
-
std::wstring_view foo{L"peace\0\0\0& love"};
std::wostringstream oss1;
void
test01()
{
- bool test [[gnu::unused]] = true;
-
using std::string_view;
string_view str0{"olympus mons"};
void
test01()
{
- bool test [[gnu::unused]] = true;
-
using std::wstring_view;
wstring_view str0{L"olympus mons"};
void
test01()
{
- bool test [[gnu::unused]] = true;
-
using std::string_view;
string_view str0{"olympus mons"};
void
test01()
{
- bool test [[gnu::unused]] = true;
-
using std::wstring_view;
wstring_view str0{L"olympus mons"};
int
test_value(int result, want_value expected)
{
- bool test [[gnu::unused]] = true;
bool pass = false;
switch (expected) {
void
test01()
{
- bool test [[gnu::unused]] = true;
-
using std::string_view;
const char lit_01[]{ 'w', 'e', '\0', 'r', 'd' };
int
test_value(int result, want_value expected)
{
- bool test [[gnu::unused]] = true;
bool pass = false;
switch (expected) {
void
test01()
{
- bool test [[gnu::unused]] = true;
-
using std::wstring_view;
const wchar_t lit_01[] = { L'w', L'e', L'\0', L'r', L'd' };
bool
test01()
{
- bool test [[gnu::unused]] = true;
-
typedef std::string_view::size_type csize_type;
const char str_lit01[] = "123456789A";
csize_type len = str01.copy(buffer, sizeof(buffer), 8);
VERIFY( 2 == len );
VERIFY( '9' == buffer[0] );
-
- return test;
}
int
bool
test01()
{
- bool test [[gnu::unused]] = true;
-
typedef std::wstring_view::size_type csize_type;
csize_type csz01;
csize_type len = str01.copy(buffer, sizeof(buffer), 8);
VERIFY( 2 == len );
VERIFY( L'9' == buffer[0] );
-
- return test;
}
int
int
test01()
{
- bool test [[gnu::unused]] = true;
-
std::string_view empty;
VERIFY( empty.size() == 0 );
int
test01()
{
- bool test [[gnu::unused]] = true;
-
std::wstring_view empty;
VERIFY( empty.size() == 0 );
#include <string_view>
#include <testsuite_hooks.h>
-bool
+void
test01()
{
- bool test [[gnu::unused]] = true;
-
typedef std::string_view::size_type csize_type;
typedef std::string_view::const_reference cref;
typedef std::string_view::reference ref;
VERIFY( csz01 == csz02 );
csz01 = str01.find('/');
VERIFY( csz01 == npos );
-
- return test;
}
int
#include <string_view>
#include <testsuite_hooks.h>
-bool
+void
test02()
{
- bool test [[gnu::unused]] = true;
-
typedef std::string_view::size_type csize_type;
csize_type npos = std::string_view::npos;
csize_type csz01, csz02;
csz01 = str01.find_first_of('z');
csz02 = str01.size() - 1;
VERIFY( csz01 == csz02 );
-
- return test;
}
int
#include <string_view>
#include <testsuite_hooks.h>
-bool
+void
test03()
{
- bool test [[gnu::unused]] = true;
-
typedef std::string_view::size_type csize_type;
csize_type npos = std::string_view::npos;
csize_type csz01;
VERIFY( csz01 == 0 );
csz01 = str04.find_first_not_of('S');
VERIFY( csz01 == npos );
-
- return test;
}
int
void
test01()
{
- bool test [[gnu::unused]] = true;
-
typedef std::string_view::size_type csize_type;
csize_type npos = std::string_view::npos;
#include <string_view>
#include <testsuite_hooks.h>
-bool
+void
test01()
{
- bool test [[gnu::unused]] = true;
-
typedef std::wstring_view::size_type csize_type;
typedef std::wstring_view::const_reference cref;
typedef std::wstring_view::reference ref;
VERIFY( csz01 == csz02 );
csz01 = str01.find(L'/');
VERIFY( csz01 == npos );
-
- return test;
}
int
#include <string_view>
#include <testsuite_hooks.h>
-bool
+void
test02()
{
- bool test [[gnu::unused]] = true;
-
typedef std::wstring_view::size_type csize_type;
csize_type npos = std::wstring_view::npos;
csize_type csz01, csz02;
csz01 = str01.find_first_of(L'z');
csz02 = str01.size() - 1;
VERIFY( csz01 == csz02 );
-
- return test;
}
int
#include <string_view>
#include <testsuite_hooks.h>
-bool
+void
test03()
{
- bool test [[gnu::unused]] = true;
-
typedef std::wstring_view::size_type csize_type;
csize_type npos = std::wstring_view::npos;
csize_type csz01;
VERIFY( csz01 == 0 );
csz01 = str04.find_first_not_of(L'S');
VERIFY( csz01 == npos );
-
- return test;
}
int
void
test01()
{
- bool test [[gnu::unused]] = true;
-
typedef std::wstring_view::size_type csize_type;
csize_type npos = std::wstring_view::npos;
// basic_string_view rfind
-bool
+void
test01()
{
- bool test [[gnu::unused]] = true;
-
typedef std::string_view::size_type csize_type;
typedef std::string_view::const_reference cref;
typedef std::string_view::reference ref;
VERIFY( csz01 == csz02 );
csz01 = str01.rfind('/');
VERIFY( csz01 == npos );
-
- return test;
}
int
// basic_string_view::find_last_of
-bool
+void
test02()
{
- bool test [[gnu::unused]] = true;
-
std::string_view z("ab");
std::string_view::size_type pos;
pos = z.find_last_of("ab");
VERIFY( pos == 1 );
pos = z.find_last_of('X');
VERIFY( pos == std::string_view::npos );
-
- return test;
}
int
// basic_string_view::find_last_not_of
-bool
+void
test03()
{
- bool test [[gnu::unused]] = true;
-
typedef std::string_view::size_type csize_type;
std::string_view::size_type pos;
csize_type npos = std::string_view::npos;
VERIFY( pos == 0 );
pos = z.find_last_not_of("Xa");
VERIFY( pos == 1 );
-
- return test;
}
int
main()
// basic_string_view rfind
-bool
+void
test01()
{
- bool test [[gnu::unused]] = true;
-
typedef std::wstring_view::size_type csize_type;
typedef std::wstring_view::const_reference cref;
typedef std::wstring_view::reference ref;
VERIFY( csz01 == csz02 );
csz01 = str01.rfind(L'/');
VERIFY( csz01 == npos );
-
- return test;
}
int
// basic_string_view::find_last_of
-bool
+void
test02()
{
- bool test [[gnu::unused]] = true;
-
std::wstring_view::size_type pos;
std::wstring_view z(L"ab");
pos = z.find_last_of(L"ab");
VERIFY( pos == 1 );
pos = z.find_last_of(L'X');
VERIFY( pos == std::wstring_view::npos );
-
- return test;
}
int
// basic_string_view::find_last_not_of
-bool
+void
test03()
{
- bool test [[gnu::unused]] = true;
-
typedef std::wstring_view::size_type csize_type;
std::wstring_view::size_type pos;
csize_type npos = std::wstring_view::npos;
VERIFY( pos == 0 );
pos = z.find_last_not_of(L"Xa");
VERIFY( pos == 1 );
-
- return test;
}
int
main()
#include <testsuite_hooks.h>
#include <testsuite_allocator.h>
-bool
+void
test01()
{
- bool test [[gnu::unused]] = true;
-
const char str_lit[] = "123456789A";
const std::string_view sv(str_lit);
char buffer[4] = { 0 };
VERIFY( std::equal(s1.begin(), s1.end(), s2.begin(), s2.end()) );
auto s3 = static_cast<std::string>(sv);
VERIFY( s3 == s1 );
-
- return test;
}
int
#include <stdexcept>
#include <testsuite_hooks.h>
-bool
+void
test01()
{
- bool test [[gnu::unused]] = true;
-
typedef std::string_view::size_type csize_type;
typedef std::string_view::const_reference cref;
typedef std::string_view::reference ref;
{
VERIFY( false );
}
-
- return test;
}
int
#include <stdexcept>
#include <testsuite_hooks.h>
-bool
+void
test01()
{
- bool test [[gnu::unused]] = true;
-
typedef std::wstring_view::size_type csize_type;
typedef std::wstring_view::const_reference cref;
typedef std::wstring_view::reference ref;
{
VERIFY( false );
}
-
- return test;
}
int
int
test01()
{
- bool test [[gnu::unused]] = true;
-
std::string_view str_0("costa rica");
std::string_view str_1("costa marbella");
std::string_view str_2("cost");
int
test01()
{
- bool test [[gnu::unused]] = true;
-
std::wstring_view str_0(L"costa rica");
std::wstring_view str_1(L"costa marbella");
std::wstring_view str_2(L"cost");
void test01()
{
- bool test __attribute__((unused)) = true;
char c = 'a';
const char cc = 'b';
char* c1 = &c;
void test01()
{
- bool test __attribute__((unused)) = true;
wchar_t c = L'a';
const wchar_t cc = L'b';
wchar_t* c1 = &c;
void test01(void)
{
- bool test __attribute__((unused)) = true;
const std::string str_01("zuma beach");
const std::string str_02("montara and ocean beach");
void test01()
{
- bool test __attribute__((unused)) = true;
-
char a = '\x7f';
char b = '\x80';
void test02(void)
{
typedef short char_type;
- bool test __attribute__((unused)) = true;
// 21.1.1 character traits requirements
void test02(void)
{
- bool test __attribute__((unused)) = true;
const std::wstring str_01(L"zuma beach");
const std::wstring str_02(L"montara and ocean beach");
#include <iterator>
#include <testsuite_hooks.h>
-#ifndef _GLIBCXX_ASSERT
+#ifdef TEST_TIMEGET_VERBOSE
# include <iostream>
# define PRINT(x) cout << #x << ": " << x << endl
# define TESTHEAD(x) cout << x << endl
#include <sstream>
#include <testsuite_hooks.h>
-#ifndef _GLIBCXX_ASSERT
+#ifdef TEST_TIMEGET_VERBOSE
# include <iostream>
# define PRINT(x) cout << #x << ": " << x << endl
# define TESTHEAD(x) cout << x << endl
#include <iterator>
#include <testsuite_hooks.h>
-#ifndef _GLIBCXX_ASSERT
+#ifdef TEST_TIMEGET_VERBOSE
# include <iostream>
# define PRINT(x) cout << #x << ": " << x << endl
# define TESTHEAD(x) cout << x << endl
#include <sstream>
#include <testsuite_hooks.h>
-#ifndef _GLIBCXX_ASSERT
+#ifdef TEST_TIMEGET_VERBOSE
# include <iostream>
# define PRINT(x) cout << #x << ": " << x << endl
# define TESTHEAD(x) cout << x << endl
#include <sys/types.h>
#include <sys/stat.h>
-// No asserts, avoid leaking the semaphores if a VERIFY fails.
-#undef _GLIBCXX_ASSERT
-
#include <testsuite_hooks.h>
// libstdc++/2913, libstdc++/4879
{
using namespace __gnu_test;
- bool test __attribute__((unused)) = true;
+ bool test = true;
const char* name = "tmp_fifo1";
semaphore s1, s2;
if (!(ofs.rdstate() & std::ios::failbit))
{
test = false;
- VERIFY( test );
}
unlink(name);
#include <sys/types.h>
#include <sys/stat.h>
-// No asserts, avoid leaking the semaphores if a VERIFY fails.
-#undef _GLIBCXX_ASSERT
-
#include <testsuite_hooks.h>
// libstdc++/9964
{
using namespace std;
using namespace __gnu_test;
- bool test __attribute__((unused)) = true;
+ bool test = true;
semaphore s1, s2;
const char* name = "tmp_fifo3";
mkfifo(name, S_IRWXU);
int child = fork();
- VERIFY( child != -1 );
+ test &= bool( child != -1 );
if (child == 0)
{
filebuf fb;
filebuf* ret = fb.open(name, ios_base::in | ios_base::out);
- VERIFY( ret != 0 );
- VERIFY( fb.is_open() );
+ test &= bool( ret != 0 );
+ test &= bool( fb.is_open() );
s1.signal();
s2.wait();
fb.sputc('a');
ret = fb.close();
- VERIFY( ret != 0 );
- VERIFY( !fb.is_open() );
+ test &= bool( ret != 0 );
+ test &= bool( !fb.is_open() );
return test;
}
#include <sys/types.h>
#include <sys/stat.h>
-// No asserts, avoid leaking the semaphores if a VERIFY fails.
-#undef _GLIBCXX_ASSERT
-
#include <testsuite_hooks.h>
// libstdc++/13171
bool test01()
{
- bool test __attribute__((unused)) = true;
+ bool test = true;
using namespace std;
using namespace __gnu_test;
fb.pubimbue(loc_fr);
fb.open(name, ios_base::in);
s1.wait();
- VERIFY( fb.is_open() );
+ test &= bool( fb.is_open() );
fb.pubimbue(loc_en);
filebuf::int_type c = fb.sgetc();
fb.close();
- VERIFY( c == 'S' );
+ test &= bool( c == 'S' );
s2.signal();
return test;
#include <sys/types.h>
#include <sys/stat.h>
-// No asserts, avoid leaking the semaphore if a VERIFY fails.
-#undef _GLIBCXX_ASSERT
-
#include <testsuite_hooks.h>
// libstdc++/14975
{
using namespace std;
using namespace __gnu_test;
- bool test __attribute__((unused)) = true;
+ bool test = true;
locale loc_us = locale(ISO_8859(1,en_US));
semaphore s1;
int child = fork();
- VERIFY( child != -1 );
+ test &= bool( child != -1 );
if (child == 0)
{
wfilebuf fb;
fb.pubimbue(loc_us);
wfilebuf* ret = fb.open(name, ios_base::out);
- VERIFY( ret != 0 );
- VERIFY( fb.is_open() );
+ test &= bool( ret != 0 );
+ test &= bool( fb.is_open() );
s1.wait();
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// No asserts, avoid leaking the semaphores if a VERIFY fails.
-#undef _GLIBCXX_ASSERT
-
#include <testsuite_hooks.h>
#include <fstream>
#include <sstream>
using namespace std;
using namespace __gnu_test;
- bool test __attribute__((unused)) = true;
+ bool test = true;
const char* name = "tmp_fifo6";
semaphore s1, s2;
int child = fork();
- VERIFY( child != -1 );
+ test &= bool( child != -1 );
if (child == 0)
{
filebuf fbout;
fbout.open(name, ios_base::in | ios_base::out);
- VERIFY( fbout.is_open() );
+ test &= bool( fbout.is_open() );
fbout.sputn("Whatever", 8);
fbout.pubsync();
s1.signal();
oss << &fbin;
fbin.close();
- VERIFY( oss.str() == "Whatever" );
+ test &= bool( oss.str() == "Whatever" );
return test;
}
#include <sys/types.h>
#include <sys/stat.h>
-// No asserts, avoid leaking the semaphores if a VERIFY fails.
-#undef _GLIBCXX_ASSERT
-
#include <testsuite_hooks.h>
class UnderBuf : public std::filebuf
{
using namespace std;
using namespace __gnu_test;
- bool test __attribute__((unused)) = true;
+ bool test = true;
const char* name = "tmp_fifo1";
if (0 != mkfifo(name, S_IRWXU))
{
- VERIFY( false );
+ test = false;
}
semaphore s1, s2;
if (fval == -1)
{
unlink(name);
- VERIFY( false );
+ test = false;
}
else if (fval == 0)
{
filebuf fbout;
fbout.open(name, ios_base::in|ios_base::out);
- VERIFY( fbout.is_open() );
+ test &= bool( fbout.is_open() );
fbout.sputn("0123456789", 10);
fbout.pubsync();
s1.wait();
--n;
UnderBuf::int_type c = fb.pub_underflow();
- VERIFY( c != UnderBuf::traits_type::eof() );
-
+ test &= bool( c != UnderBuf::traits_type::eof() );
+
fb.sbumpc();
}
using namespace std;
-#ifndef _GLIBCXX_ASSERT
-# define TEST_NUMPUT_VERBOSE 1
-#endif
-
struct _TestCase
{
double val;
#include <string>
#include <testsuite_hooks.h>
-#ifndef _GLIBCXX_ASSERT
-# define TEST_NUMPUT_VERBOSE 1
-#endif
-
#ifdef TEST_NUMPUT_VERBOSE
# include <iostream>
#endif
using namespace std;
-#ifndef _GLIBCXX_ASSERT
-# define TEST_NUMPUT_VERBOSE 1
-#endif
-
struct _TestCase
{
double val;
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
-
-// No asserts, avoid leaking the semaphore if a VERIFY fails.
-#undef _GLIBCXX_ASSERT
-
#include <testsuite_hooks.h>
// Check that cout.flush() is called when last ios_base::Init is destroyed.
{
using namespace std;
using namespace __gnu_test;
- bool test __attribute__((unused)) = true;
+ bool test = true;
const char* name = "tmp_fifo4";
semaphore s1;
int child = fork();
- VERIFY( child != -1 );
+ test &= bool( child != -1 );
if (child == 0)
{
filebuf fbout;
fbout.open(name, ios_base::in|ios_base::out);
- VERIFY( fbout.is_open() );
+ test &= bool( fbout.is_open() );
s1.wait();
cout.rdbuf(&fbout);
fbout.sputc('a');
fbin.open(name, ios_base::in);
s1.signal();
filebuf::int_type c = fbin.sbumpc();
- VERIFY( c != filebuf::traits_type::eof() );
- VERIFY( c == filebuf::traits_type::to_int_type('a') );
+ test &= bool( c != filebuf::traits_type::eof() );
+ test &= bool( c == filebuf::traits_type::to_int_type('a') );
fbin.close();
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// No asserts, avoid leaking the semaphores if a VERIFY fails.
-#undef _GLIBCXX_ASSERT
-
#include <testsuite_hooks.h>
#include <cstdio>
#include <cstdlib>
using namespace std;
using namespace __gnu_test;
- bool test __attribute__((unused)) = true;
+ bool test = true;
const char* name = "tmp_fifo5";
semaphore s1, s2;
int child = fork();
- VERIFY( child != -1 );
+ test &= bool( child != -1 );
if (child == 0)
{
FILE* file = fopen(name, "r+");
- VERIFY( file != 0 );
+ test &= bool( file != 0 );
fputs("Whatever\n", file);
fflush(file);
s1.signal();
exit(0);
}
- VERIFY( freopen(name, "r", stdin) );
+ test &= bool( freopen(name, "r", stdin) );
s1.wait();
int c1 = fgetc(stdin);
- VERIFY( c1 != EOF );
+ test &= bool( c1 != EOF );
int c2 = cin.rdbuf()->sputbackc('a');
- VERIFY( c2 != EOF );
- VERIFY( c2 == 'a' );
+ test &= bool( c2 != EOF );
+ test &= bool( c2 == 'a' );
int c3 = fgetc(stdin);
- VERIFY( c3 != EOF );
- VERIFY( c3 == c2 );
+ test &= bool( c3 != EOF );
+ test &= bool( c3 == c2 );
int c4 = ungetc('b', stdin);
- VERIFY( c4 != EOF );
- VERIFY( c4 == 'b' );
+ test &= bool( c4 != EOF );
+ test &= bool( c4 == 'b' );
int c5 = cin.rdbuf()->sgetc();
- VERIFY( c5 != EOF );
- VERIFY( c5 == c4 );
+ test &= bool( c5 != EOF );
+ test &= bool( c5 == c4 );
s2.signal();
s1.wait();
#include <sys/types.h>
#include <sys/stat.h>
-// No asserts, avoid leaking the semaphore if a VERIFY fails.
-#undef _GLIBCXX_ASSERT
-
#include <testsuite_hooks.h>
// Check that wcout.flush() is called when last ios_base::Init is destroyed.
{
using namespace std;
using namespace __gnu_test;
- bool test __attribute__((unused)) = true;
+ bool test = true;
const char* name = "tmp_fifo4";
semaphore s1;
int child = fork();
- VERIFY( child != -1 );
+ test &= bool( child != -1 );
if (child == 0)
{
fbin.open(name, ios_base::in);
s1.signal();
wfilebuf::int_type c = fbin.sbumpc();
- VERIFY( c != wfilebuf::traits_type::eof() );
- VERIFY( c == wfilebuf::traits_type::to_int_type(L'a') );
+ test &= bool( c != wfilebuf::traits_type::eof() );
+ test &= bool( c == wfilebuf::traits_type::to_int_type(L'a') );
fbin.close();
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// No asserts, avoid leaking the semaphores if a VERIFY fails.
-#undef _GLIBCXX_ASSERT
-
#include <testsuite_hooks.h>
#include <cstdio>
#include <cstdlib>
using namespace std;
using namespace __gnu_test;
- bool test __attribute__((unused)) = true;
+ bool test = true;
const char* name = "tmp_fifo5";
semaphore s1, s2;
int child = fork();
- VERIFY( child != -1 );
+ test &= bool( child != -1 );
if (child == 0)
{
exit(0);
}
- VERIFY( freopen(name, "r", stdin) );
+ test &= bool( freopen(name, "r", stdin) );
s1.wait();
wint_t c1 = fgetwc(stdin);
- VERIFY( c1 != WEOF );
+ test &= bool( c1 != WEOF );
wint_t c2 = wcin.rdbuf()->sputbackc(L'a');
- VERIFY( c2 != WEOF );
- VERIFY( c2 == L'a' );
+ test &= bool( c2 != WEOF );
+ test &= bool( c2 == L'a' );
wint_t c3 = fgetwc(stdin);
- VERIFY( c3 != WEOF );
- VERIFY( c3 == c2 );
+ test &= bool( c3 != WEOF );
+ test &= bool( c3 == c2 );
wint_t c4 = ungetwc(L'b', stdin);
- VERIFY( c4 != WEOF );
- VERIFY( c4 == L'b' );
+ test &= bool( c4 != WEOF );
+ test &= bool( c4 == L'b' );
wint_t c5 = wcin.rdbuf()->sgetc();
- VERIFY( c5 != WEOF );
- VERIFY( c5 == c4 );
+ test &= bool( c5 != WEOF );
+ test &= bool( c5 == c4 );
s2.signal();
s1.wait();
# Default settings.
set cxx [transform "g++"]
- set cxxflags "-D_GLIBCXX_ASSERT -fmessage-length=0"
+ set cxxflags "-fmessage-length=0"
set cxxpchflags ""
set cxxvtvflags ""
set cxxldflags ""
// This file provides the following:
//
-// 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.
+// 1) VERIFY()
//
// 2) set_memory_limits()
// set_memory_limits() uses setrlimit() to restrict dynamic memory
#include <sys/stat.h>
#endif
-#ifdef _GLIBCXX_ASSERT
-# include <cassert>
-# define VERIFY(fn) assert(fn)
-#else
-# define VERIFY(fn) test &= bool(fn)
-#endif
+#define VERIFY(fn) \
+ do \
+ { \
+ if (! (fn)) \
+ { \
+ __builtin_printf("%s:%d: %s: Assertion '%s' failed.\n", \
+ __FILE__, __LINE__, __PRETTY_FUNCTION__, #fn); \
+ __builtin_abort(); \
+ } \
+ } while (false)
#ifdef _GLIBCXX_HAVE_UNISTD_H
# include <unistd.h>