2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 * @file test_type_list.cpp
18 * @author Krzysztof Jackiewicz (k.jackiewicz@samsung.com)
23 #include <dpl/test/test_runner.h>
24 #include <dpl/type_list.h>
26 RUNNER_TEST_GROUP_INIT(DPL)
29 Name: TypeList_TypeCount
30 Description: tests size of typelist idiom
31 Expected: size should match
33 RUNNER_TEST(TypeList_TypeCount)
35 typedef DPL::TypeListDecl<int, char, int[64]>::Type TestTypeList1;
36 typedef DPL::TypeListDecl<int>::Type TestTypeList2;
37 typedef DPL::TypeListDecl<>::Type TestTypeList3;
38 typedef DPL::TypeList<int, TestTypeList1> TestTypeList4;
40 RUNNER_ASSERT(TestTypeList1::Size == 3);
41 RUNNER_ASSERT(TestTypeList2::Size == 1);
42 RUNNER_ASSERT(TestTypeList3::Size == 0);
43 RUNNER_ASSERT(TestTypeList4::Size == 4);
45 RUNNER_ASSERT(TestTypeList4::Tail::Tail::Size == 2);