type_cpp_unittest.cpp revision a2f77c40fb6287895e2030055c0104eac0a1f73a
1/*
2 * Copyright (C) 2015, The Android Open Source Project
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 <memory>
18
19#include <gtest/gtest.h>
20
21#include "type_cpp.h"
22
23namespace android {
24namespace aidl {
25namespace cpp {
26
27class CppTypeNamespaceTest : public ::testing::Test {
28 protected:
29  void SetUp() override {
30    types_.Init();
31  }
32  TypeNamespace types_;
33};
34
35TEST_F(CppTypeNamespaceTest, HasSomeBasicTypes) {
36  EXPECT_TRUE(types_.HasType("byte"));
37  EXPECT_TRUE(types_.HasType("int"));
38  EXPECT_TRUE(types_.HasType("long"));
39  EXPECT_TRUE(types_.HasType("float"));
40  EXPECT_TRUE(types_.HasType("double"));
41  EXPECT_TRUE(types_.HasType("boolean"));
42  EXPECT_TRUE(types_.HasType("char"));
43  EXPECT_TRUE(types_.HasType("String"));
44}
45
46TEST_F(CppTypeNamespaceTest, SupportsListString) {
47  EXPECT_TRUE(types_.HasType("List<String>"));
48}
49
50}  // namespace cpp
51}  // namespace android
52}  // namespace aidl
53