From 1678e1fde683b3cd7748ef3eb021f1d7de52f3d5 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Tue, 26 Jun 2001 13:41:10 +0000 Subject: [PATCH] function_n_test.cpp: function_test.cpp: - Add tests for self-assignment [SVN r10433] --- test/function_n_test.cpp | 6 ++++-- test/function_test.cpp | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/test/function_n_test.cpp b/test/function_n_test.cpp index 9cc13ed..a39a70b 100644 --- a/test/function_n_test.cpp +++ b/test/function_n_test.cpp @@ -73,16 +73,18 @@ test_zero_args() v1 = three; BOOST_TEST(!v1.empty()); - // Invocation + // Invocation and self-assignment global_int = 0; + v1 = v1; v1(); BOOST_TEST(global_int == 3); // Assignment to a non-empty function v1 = five; - // Invocation + // Invocation and self-assignment global_int = 0; + v1.set(v1); v1(); BOOST_TEST(global_int == 5); diff --git a/test/function_test.cpp b/test/function_test.cpp index 2f734ff..55d448d 100644 --- a/test/function_test.cpp +++ b/test/function_test.cpp @@ -73,16 +73,18 @@ test_zero_args() v1 = three; BOOST_TEST(!v1.empty()); - // Invocation + // Invocation and self-assignment global_int = 0; + v1 = v1; v1(); BOOST_TEST(global_int == 3); // Assignment to a non-empty function v1 = five; - // Invocation + // Invocation and self-assignment global_int = 0; + v1.set(v1); v1(); BOOST_TEST(global_int == 5);