diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 1999-11-07 18:13:13 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 1999-11-07 18:13:13 +0000 |
commit | d70bbd2cc7ea69e37ab9de711c6778a2acb6e025 (patch) | |
tree | 315ba2bd16c8147983a1cd2611f604d6f6ef7e09 /tests/Auto_IncDec_Test.cpp | |
parent | 17a726ad15e243e2898acac0f0d2a028a19fedb7 (diff) | |
download | ATCD-d70bbd2cc7ea69e37ab9de711c6778a2acb6e025.tar.gz |
ChangeLogTag:Sun Nov 7 12:03:31 1999 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu>
Diffstat (limited to 'tests/Auto_IncDec_Test.cpp')
-rw-r--r-- | tests/Auto_IncDec_Test.cpp | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/tests/Auto_IncDec_Test.cpp b/tests/Auto_IncDec_Test.cpp new file mode 100644 index 00000000000..a9a5563b2af --- /dev/null +++ b/tests/Auto_IncDec_Test.cpp @@ -0,0 +1,64 @@ +// $Id$ + +//============================================================================ +// +// = LIBRARY +// tests +// +// = FILENAME +// Auto_IncDec_Test.cpp +// +// = DESCRIPTION +// This is a simple test of the Auto Increment/Decrement Class in +// ACE. On platforms like Win32, ACE uses template specialization +// to use native implementations provided by the OS to accelarate +// these operations. +// +// = AUTHOR +// Edan Ayal <EdanA@cti2.com> +// +//============================================================================ + +#include "ace/Auto_IncDec_T.h" +#include "tests/test_config.h" + +ACE_RCSID(tests, Auto_IncDec_Test, "Auto_IncDec_Test.cpp, by Edan Ayal") + +#if defined(__BORLANDC__) && __BORLANDC__ >= 0x0530 +USELIB("..\ace\aced.lib"); +//--------------------------------------------------------------------------- +#endif /* defined(__BORLANDC__) && __BORLANDC__ >= 0x0530 */ + +int +main (int, ASYS_TCHAR *[]) +{ + ACE_START_TEST (ASYS_TEXT ("Auto_IncDec_Test")); + + int counter = 0; + { + ACE_Auto_IncDec<int> Auto_IncDec1 (counter); + ACE_ASSERT (counter == 1); + + ACE_Auto_IncDec<int> Auto_IncDec2 (counter); + ACE_ASSERT (counter == 2); + + { + ACE_ASSERT (counter == 2); + ACE_Auto_IncDec<int> Auto_IncDec3 (counter); + ACE_ASSERT (counter == 3); + } + + ACE_ASSERT (counter == 2); + } + + ACE_ASSERT (counter == 0); + + ACE_END_TEST; + return 0; +} + +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) +template class ACE_Auto_IncDec<int>; +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) +#pragma instantiate ACE_Auto_IncDec<int> +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ |