Tizen 2.0 Release
[framework/web/wrt-commons.git] / tests / dpl / core / test_type_list.cpp
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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  * @file       test_type_list.cpp
18  * @author     Krzysztof Jackiewicz (k.jackiewicz@samsung.com)
19  * @version    0.1
20  * @brief
21  */
22
23 #include <dpl/test/test_runner.h>
24 #include <dpl/type_list.h>
25
26 RUNNER_TEST_GROUP_INIT(DPL)
27
28 RUNNER_TEST(TypeList_TypeCount)
29 {
30     typedef DPL::TypeListDecl<int, char, int[64]>::Type TestTypeList1;
31     typedef DPL::TypeListDecl<int>::Type TestTypeList2;
32     typedef DPL::TypeListDecl<>::Type TestTypeList3;
33     typedef DPL::TypeList<int, TestTypeList1> TestTypeList4;
34
35     RUNNER_ASSERT(TestTypeList1::Size == 3);
36     RUNNER_ASSERT(TestTypeList2::Size == 1);
37     RUNNER_ASSERT(TestTypeList3::Size == 0);
38     RUNNER_ASSERT(TestTypeList4::Size == 4);
39
40     RUNNER_ASSERT(TestTypeList4::Tail::Tail::Size == 2);
41 }