Switched to <boost/detail/lightweight_test.hpp> for testing.

[SVN r14932]
This commit is contained in:
Peter Dimov
2002-08-16 16:41:16 +00:00
parent 8436c4d271
commit c2ee5172b0
3 changed files with 182 additions and 185 deletions

View File

@ -19,9 +19,6 @@
#include <boost/shared_ptr.hpp>
#include <boost/bind.hpp>
#define BOOST_INCLUDE_MAIN
#include <boost/test/test_tools.hpp>
#include <vector>
#include <memory>
#include <stdexcept>
@ -153,7 +150,7 @@ int const m = 16; // threads
char const * implementation = "spinlock";
#endif
int test_main( int, char ** )
int main()
{
std::printf("%s: %s, %d threads, %d iterations: ", title, implementation, m, n);

View File

@ -16,8 +16,7 @@
// warranty, and with no claim as to its suitability for any purpose.
//
#define BOOST_INCLUDE_MAIN
#include <boost/test/test_tools.hpp>
#include <boost/detail/lightweight_test.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/weak_ptr.hpp>
@ -197,7 +196,7 @@ template<class T> void test_is_nonzero(boost::shared_ptr<T> const & p)
BOOST_TEST(p.get() != 0);
}
int test_main(int, char * [])
int main()
{
using namespace boost;
@ -369,5 +368,5 @@ int test_main(int, char * [])
BOOST_TEST(cnt == 0);
return 0;
return boost::report_errors();
}

View File

@ -18,8 +18,7 @@
#include <boost/shared_ptr.hpp>
#include <boost/shared_array.hpp>
#define BOOST_INCLUDE_MAIN
#include <boost/test/test_tools.hpp>
#include <boost/detail/lightweight_test.hpp>
#include <cstring>
#include <iostream>
@ -84,12 +83,11 @@ Incomplete * check_incomplete( shared_ptr<Incomplete>& incomplete,
cout << incomplete.use_count() << ' ' << incomplete.unique() << '\n';
return incomplete.get();
}
// main --------------------------------------------------------------------//
// This isn't a very systematic test; it just hits some of the basics.
int test_main( int, char *[] ) {
void test()
{
BOOST_TEST( UDT_use_count == 0 ); // reality check
// test scoped_ptr with a built-in type
@ -289,7 +287,10 @@ int test_main( int, char *[] ) {
cout << "OK\n";
new char[12345]; // deliberate memory leak to verify leaks detected
}
return 0;
} // main
int main()
{
test();
return boost::report_errors();
}