summaryrefslogtreecommitdiff
path: root/ACE/tests
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2018-12-27 18:52:00 +0100
committerGitHub <noreply@github.com>2018-12-27 18:52:00 +0100
commit83782cebd09e06d3117aad09ae73c5e9e96152fc (patch)
tree54d7346a2cae23465405ca2e429b65fc4facfb86 /ACE/tests
parent130b7d62d9f5c2d8ed603964bf8afc1011e9ffc3 (diff)
parent0fc30571a28d5eb0bb1153a4f827069a15508ca8 (diff)
downloadATCD-83782cebd09e06d3117aad09ae73c5e9e96152fc.tar.gz
Merge pull request #777 from iguessthislldo/igtd/vector
Fix end() on ACE_Vector
Diffstat (limited to 'ACE/tests')
-rw-r--r--ACE/tests/.gitignore4
-rw-r--r--ACE/tests/Vector_Test.cpp31
2 files changed, 33 insertions, 2 deletions
diff --git a/ACE/tests/.gitignore b/ACE/tests/.gitignore
index c2402c11670..8da5ea9d5fd 100644
--- a/ACE/tests/.gitignore
+++ b/ACE/tests/.gitignore
@@ -272,3 +272,7 @@
/XtAthenaReactor_Test
/XtMotifReactor_Test
/XtReactor_Test
+/Compiler_Features_36_Test
+/Compiler_Features_37_Test
+/Compiler_Features_38_Test
+/SOCK_Acceptor_Test
diff --git a/ACE/tests/Vector_Test.cpp b/ACE/tests/Vector_Test.cpp
index 5470166b176..cac2f398faa 100644
--- a/ACE/tests/Vector_Test.cpp
+++ b/ACE/tests/Vector_Test.cpp
@@ -9,11 +9,10 @@
*/
//=============================================================================
+#include <algorithm>
#include "test_config.h"
-
-
#include "ace/Vector_T.h"
typedef size_t DATA;
@@ -157,6 +156,34 @@ int run_main (int, ACE_TCHAR *[])
if (v2.size () != 3)
ACE_ERROR ((LM_ERROR, ACE_TEXT ("v2's size should be 3\n")));
+ // Assert that vector standard iterators work
+ {
+ VECTOR vector;
+ const size_t size = 200;
+ const size_t offset = 5;
+
+ ACE_TEST_ASSERT (vector.begin () == vector.end ());
+
+ size_t i;
+ for (i = 0; i < size; i++)
+ {
+ vector.push_back (i + offset);
+ }
+
+ i = 0;
+ for (VECTOR::iterator it = vector.begin (); it != vector.end (); ++it)
+ {
+ ACE_TEST_ASSERT (*it == i++ + offset);
+ }
+
+ std::reverse (vector.begin (), vector.end());
+ i = size - 1;
+ for (VECTOR::iterator it = vector.begin (); it != vector.end (); ++it)
+ {
+ ACE_TEST_ASSERT (*it == i-- + offset);
+ }
+ }
+
ACE_END_TEST;
return 0;