function_n_test.cpp:

function_test.cpp:
	- Add tests for self-assignment


[SVN r10433]
This commit is contained in:
Douglas Gregor
2001-06-26 13:41:10 +00:00
parent 07c66d01fa
commit 1678e1fde6
2 changed files with 8 additions and 4 deletions

View File

@ -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);