1*04179683SPavel Kumbrasev /*
2*04179683SPavel Kumbrasev     Copyright (c) 2005-2023 Intel Corporation
3*04179683SPavel Kumbrasev 
4*04179683SPavel Kumbrasev     Licensed under the Apache License, Version 2.0 (the "License");
5*04179683SPavel Kumbrasev     you may not use this file except in compliance with the License.
6*04179683SPavel Kumbrasev     You may obtain a copy of the License at
7*04179683SPavel Kumbrasev 
8*04179683SPavel Kumbrasev         http://www.apache.org/licenses/LICENSE-2.0
9*04179683SPavel Kumbrasev 
10*04179683SPavel Kumbrasev     Unless required by applicable law or agreed to in writing, software
11*04179683SPavel Kumbrasev     distributed under the License is distributed on an "AS IS" BASIS,
12*04179683SPavel Kumbrasev     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13*04179683SPavel Kumbrasev     See the License for the specific language governing permissions and
14*04179683SPavel Kumbrasev     limitations under the License.
15*04179683SPavel Kumbrasev */
16*04179683SPavel Kumbrasev 
17*04179683SPavel Kumbrasev #include "common/config.h"
18*04179683SPavel Kumbrasev 
19*04179683SPavel Kumbrasev #include "test_join_node.h"
20*04179683SPavel Kumbrasev 
21*04179683SPavel Kumbrasev //! \file test_join_node_key_matching_n_args.cpp
22*04179683SPavel Kumbrasev //! \brief Test for [flow_graph.join_node] specification
23*04179683SPavel Kumbrasev 
24*04179683SPavel Kumbrasev template <typename T1, typename T2>
25*04179683SPavel Kumbrasev using make_tuple = decltype(std::tuple_cat(T1(), std::tuple<T2>()));
26*04179683SPavel Kumbrasev using T1 = std::tuple<MyKeyFirst<std::string, double>>;
27*04179683SPavel Kumbrasev using T2 = make_tuple<T1, MyKeySecond<std::string, int>>;
28*04179683SPavel Kumbrasev using T3 = make_tuple<T2, MyKeyFirst<std::string, int>>;
29*04179683SPavel Kumbrasev using T4 = make_tuple<T3, MyKeyWithBrokenMessageKey<std::string, size_t>>;
30*04179683SPavel Kumbrasev using T5 = make_tuple<T4, MyKeyWithBrokenMessageKey<std::string, int>>;
31*04179683SPavel Kumbrasev using T6 = make_tuple<T5, MyKeySecond<std::string, short>>;
32*04179683SPavel Kumbrasev using T7 = make_tuple<T6, MyKeySecond<std::string, threebyte>>;
33*04179683SPavel Kumbrasev using T8 = make_tuple<T7, MyKeyFirst<std::string, int>>;
34*04179683SPavel Kumbrasev using T9 = make_tuple<T8, MyKeySecond<std::string, threebyte>>;
35*04179683SPavel Kumbrasev using T10 = make_tuple<T9, MyKeyWithBrokenMessageKey<std::string, size_t>>;
36*04179683SPavel Kumbrasev 
37*04179683SPavel Kumbrasev #if TBB_TEST_LOW_WORKLOAD && TBB_USE_DEBUG
38*04179683SPavel Kumbrasev // the compiler might generate huge object file in debug (>64M)
39*04179683SPavel Kumbrasev #define TEST_CASE_TEMPLATE_N_ARGS(dec) TEST_CASE_TEMPLATE(dec, T, T2, T5, T8, T10)
40*04179683SPavel Kumbrasev #else
41*04179683SPavel Kumbrasev #define TEST_CASE_TEMPLATE_N_ARGS(dec) TEST_CASE_TEMPLATE(dec, T, T2, T3, T4, T5, T6, T7, T8, T9, T10)
42*04179683SPavel Kumbrasev #endif
43*04179683SPavel Kumbrasev 
44*04179683SPavel Kumbrasev //! Serial test with different tuple sizes
45*04179683SPavel Kumbrasev //! \brief \ref error_guessing
46*04179683SPavel Kumbrasev TEST_CASE_TEMPLATE_N_ARGS("Serial N tests on tuples") {
47*04179683SPavel Kumbrasev      generate_test<serial_test, T, tbb::flow::key_matching<std::string&>>::do_test();
48*04179683SPavel Kumbrasev }
49*04179683SPavel Kumbrasev 
50*04179683SPavel Kumbrasev //! Parallel test with different tuple sizes
51*04179683SPavel Kumbrasev //! \brief \ref error_guessing
52*04179683SPavel Kumbrasev TEST_CASE_TEMPLATE_N_ARGS("Parallel N tests on tuples") {
53*04179683SPavel Kumbrasev     generate_test<parallel_test, T, tbb::flow::key_matching<std::string&>>::do_test();
54*04179683SPavel Kumbrasev }
55