From 63a83096a84298eee4bd41ea35aaac491d866959 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Fri, 27 Feb 2015 21:36:43 +0100 Subject: [PATCH] Add small function to test conversion to small_vector_base --- test/small_vector_test.cpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/test/small_vector_test.cpp b/test/small_vector_test.cpp index 76eb0ca..cb3fb14 100644 --- a/test/small_vector_test.cpp +++ b/test/small_vector_test.cpp @@ -81,6 +81,32 @@ struct alloc_propagate_base }}} //namespace boost::container::test +bool test_small_vector_base_test() +{ + typedef boost::container::small_vector_base smb_t; + { + typedef boost::container::small_vector sm5_t; + sm5_t sm5; + smb_t &smb = sm5; + smb.push_back(1); + sm5_t sm5_copy(sm5); + sm5_copy.push_back(1); + if (!boost::container::test::CheckEqualContainers(sm5, smb)) + return false; + } + { + typedef boost::container::small_vector sm7_t; + sm7_t sm7; + smb_t &smb = sm7; + smb.push_back(2); + sm7_t sm7_copy(sm7); + sm7_copy.push_back(2); + if (!boost::container::test::CheckEqualContainers(sm7, smb)) + return false; + } + return true; +} + int main() { using namespace boost::container; @@ -147,5 +173,12 @@ int main() return 1; } + //////////////////////////////////// + // Small vector base + //////////////////////////////////// + if (!test_small_vector_base_test()){ + return 1; + } + return 0; }