From 24e95c34fb6d659fcb1078874b5eb7c3c0a05eda Mon Sep 17 00:00:00 2001 From: Kohei Takahashi Date: Mon, 1 Dec 2014 03:42:38 +0900 Subject: [PATCH] Add tests for #9914 --- test/Jamfile | 6 ++++++ test/support/pair_container.hpp | 27 +++++++++++++++++++++++++++ test/support/pair_deque.cpp | 17 +++++++++++++++++ test/support/pair_list.cpp | 17 +++++++++++++++++ test/support/pair_map.cpp | 17 +++++++++++++++++ test/support/pair_set.cpp | 17 +++++++++++++++++ test/support/pair_vector.cpp | 17 +++++++++++++++++ 7 files changed, 118 insertions(+) create mode 100644 test/support/pair_container.hpp create mode 100644 test/support/pair_deque.cpp create mode 100644 test/support/pair_list.cpp create mode 100644 test/support/pair_map.cpp create mode 100644 test/support/pair_set.cpp create mode 100644 test/support/pair_vector.cpp diff --git a/test/Jamfile b/test/Jamfile index 5036ab07..8a459b81 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -179,6 +179,12 @@ project [ run functional/invoke_procedure.cpp : : : : ] [ run sequence/swap.cpp : : : : ] + [ compile support/pair_deque.cpp : : : : ] + [ compile support/pair_list.cpp : : : : ] + [ compile support/pair_map.cpp : : : : ] + [ compile support/pair_set.cpp : : : : ] + [ compile support/pair_vector.cpp : : : : ] + # [ compile-fail xxx.cpp : : : : ] ; diff --git a/test/support/pair_container.hpp b/test/support/pair_container.hpp new file mode 100644 index 00000000..3e84f058 --- /dev/null +++ b/test/support/pair_container.hpp @@ -0,0 +1,27 @@ +/*============================================================================= + Copyright (c) 2014 Kohei Takahashi + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#include +#include + +using namespace boost::fusion; + +template +void copy() +{ + pair src; + pair dest = src; + boost::ignore_unused(dest); +} + +void test() +{ + copy >(); + copy >(); + copy >(); +} + diff --git a/test/support/pair_deque.cpp b/test/support/pair_deque.cpp new file mode 100644 index 00000000..27da30ec --- /dev/null +++ b/test/support/pair_deque.cpp @@ -0,0 +1,17 @@ +/*============================================================================= + Copyright (c) 2014 Kohei Takahashi + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#include + +#define FUSION_SEQUENCE deque +#define TEST_TYPE int +#include "./pair_container.hpp" + +int main() +{ + test(); +} + diff --git a/test/support/pair_list.cpp b/test/support/pair_list.cpp new file mode 100644 index 00000000..ce478ff6 --- /dev/null +++ b/test/support/pair_list.cpp @@ -0,0 +1,17 @@ +/*============================================================================= + Copyright (c) 2014 Kohei Takahashi + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#include + +#define FUSION_SEQUENCE list +#define TEST_TYPE int +#include "./pair_container.hpp" + +int main() +{ + test(); +} + diff --git a/test/support/pair_map.cpp b/test/support/pair_map.cpp new file mode 100644 index 00000000..d472ba26 --- /dev/null +++ b/test/support/pair_map.cpp @@ -0,0 +1,17 @@ +/*============================================================================= + Copyright (c) 2014 Kohei Takahashi + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#include + +#define FUSION_SEQUENCE map +#define TEST_TYPE pair +#include "./pair_container.hpp" + +int main() +{ + test(); +} + diff --git a/test/support/pair_set.cpp b/test/support/pair_set.cpp new file mode 100644 index 00000000..b346a8ba --- /dev/null +++ b/test/support/pair_set.cpp @@ -0,0 +1,17 @@ +/*============================================================================= + Copyright (c) 2014 Kohei Takahashi + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#include + +#define FUSION_SEQUENCE set +#define TEST_TYPE int +#include "./pair_container.hpp" + +int main() +{ + test(); +} + diff --git a/test/support/pair_vector.cpp b/test/support/pair_vector.cpp new file mode 100644 index 00000000..62a4f2b5 --- /dev/null +++ b/test/support/pair_vector.cpp @@ -0,0 +1,17 @@ +/*============================================================================= + Copyright (c) 2014 Kohei Takahashi + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#include + +#define FUSION_SEQUENCE vector +#define TEST_TYPE int +#include "./pair_container.hpp" + +int main() +{ + test(); +} +