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