diff --git a/test/function_n_test.cpp b/test/function_n_test.cpp index 48db084..c88a72f 100644 --- a/test/function_n_test.cpp +++ b/test/function_n_test.cpp @@ -1,6 +1,6 @@ // Boost.Function library -// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu) +// Copyright (C) 2001-2002 Doug Gregor (gregod@cs.rpi.edu) // // Permission to copy, use, sell and distribute this software is granted // provided this copyright notice appears in all copies. @@ -93,7 +93,7 @@ test_zero_args() // Invocation and self-assignment global_int = 0; - v1.set(v1); + v1 = (v1); v1(); BOOST_TEST(global_int == 5); @@ -152,7 +152,7 @@ test_zero_args() BOOST_TEST(global_int == 3); // Assignment to a non-empty function - v2.set(five); + v2 = (five); // Invocation global_int = 0; @@ -163,7 +163,7 @@ test_zero_args() BOOST_TEST(v2.empty()); // Assignment to an empty function from a free function - v2.set(&write_five); + v2 = (&write_five); BOOST_TEST(v2); // Invocation diff --git a/test/function_test.cpp b/test/function_test.cpp index 1b721a5..f4f11f8 100644 --- a/test/function_test.cpp +++ b/test/function_test.cpp @@ -1,6 +1,6 @@ // Boost.Function library -// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu) +// Copyright (C) 2001-2002 Doug Gregor (gregod@cs.rpi.edu) // // Permission to copy, use, sell and distribute this software is granted // provided this copyright notice appears in all copies. @@ -93,7 +93,7 @@ test_zero_args() // Invocation and self-assignment global_int = 0; - v1.set(v1); + v1 = (v1); v1(); BOOST_TEST(global_int == 5); @@ -152,7 +152,7 @@ test_zero_args() BOOST_TEST(global_int == 3); // Assignment to a non-empty function - v2.set(five); + v2 = (five); // Invocation global_int = 0; @@ -163,7 +163,7 @@ test_zero_args() BOOST_TEST(v2.empty()); // Assignment to an empty function from a free function - v2.set(BOOST_FUNCTION_TARGET_FIX(&) write_five); + v2 = (BOOST_FUNCTION_TARGET_FIX(&) write_five); BOOST_TEST(v2); // Invocation diff --git a/test/mixin_test.cpp b/test/mixin_test.cpp deleted file mode 100644 index 61c7200..0000000 --- a/test/mixin_test.cpp +++ /dev/null @@ -1,60 +0,0 @@ -// Boost.Function library - -// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu) -// -// Permission to copy, use, sell and distribute this software is granted -// provided this copyright notice appears in all copies. -// Permission to modify the code and to distribute modified code is granted -// provided this copyright notice appears in all copies, and a notice -// that the code was modified is included with the copyright notice. -// -// This software is provided "as is" without express or implied warranty, -// and with no claim as to its suitability for any purpose. - -// For more information, see http://www.boost.org - -#define BOOST_INCLUDE_MAIN -#include -#include -#include -#include - -struct id_mixin -{ - id_mixin(const id_mixin& rhs) : id(rhs.id) {} - id_mixin& operator=(const id_mixin& rhs){id = rhs.id; return *this;} - id_mixin(int i = 0){ id = i;} - int id; -}; - -static int do_plus(int x, int y) { return x+y; } - -typedef boost::function::mixin::type func; - -int test_main(int, char*[]) -{ - func f(id_mixin(3)); - f = std::plus(); - BOOST_TEST(f.id == 3); - - f = &do_plus; - BOOST_TEST(f.id == 3); - - f.clear(); - f.id = 7; - BOOST_TEST(f.id == 7); - - func g(f); - BOOST_TEST(g.id == 7); - - f.id = 21; - BOOST_TEST(f.id == 21); - - boost::swap(f,g); - BOOST_TEST(f.id == 7); - BOOST_TEST(g.id == 21); - - g = f; - BOOST_TEST(g.id == 7); - return 0; -} diff --git a/test/policy_test.cpp b/test/policy_test.cpp deleted file mode 100644 index cee8f93..0000000 --- a/test/policy_test.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// Boost.Function library - -// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu) -// -// Permission to copy, use, sell and distribute this software is granted -// provided this copyright notice appears in all copies. -// Permission to modify the code and to distribute modified code is granted -// provided this copyright notice appears in all copies, and a notice -// that the code was modified is included with the copyright notice. -// -// This software is provided "as is" without express or implied warranty, -// and with no claim as to its suitability for any purpose. - -// For more information, see http://www.boost.org - -#define BOOST_INCLUDE_MAIN -#include -#include -#include -#include -#include - -using namespace std; -using namespace boost; - -struct counting_policy -{ - static int count; - - void precall(const function_base*) { count++; } - void postcall(const function_base*) { count+=2; } -}; - -int counting_policy::count = 0; - -int -test_main(int, char*[]) -{ - function::policy::type f; - - f = plus(); - - BOOST_TEST(5 == f(2,3)); - BOOST_TEST(counting_policy::count==3); - - return 0; -}