MCPcopy Create free account
hub / github.com/Samsung/UTopia / TEST_F

Function TEST_F

tests/type/TestType.cpp:53–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51};
52
53TEST_F(TestType, TypeP) {
54 const std::string Code =
55 "extern \"C\" {\n"
56 "enum E1 { Enum0, Enum1 };\n"
57 "void test_defined(E1 P4);\n"
58 "void test_primitive(int P1, float P2);\n"
59 "void test_ptr(int *P1, char *P2, int P3[10], int P4) {\n"
60 " int Var[P4];\n"
61 "}\n"
62 "}";
63 ASSERT_TRUE(loadCPP(Code));
64 std::shared_ptr<Type> T;
65
66 T = create("int");
67 ASSERT_TRUE(T);
68 ASSERT_TRUE(T->isIntegerType());
69
70 T = create("float");
71 ASSERT_TRUE(T);
72 ASSERT_TRUE(T->isFloatType());
73
74 T = create("enum E1");
75 ASSERT_TRUE(T);
76 ASSERT_TRUE(T->getKind() == Type::TypeID_Enum);
77
78 T = create("int *");
79 ASSERT_TRUE(T);
80 ASSERT_TRUE(T->isPointerType());
81 ASSERT_TRUE(T->isNormalPtr());
82
83 T = create("char *");
84 ASSERT_TRUE(T);
85 ASSERT_TRUE(T->isPointerType());
86 ASSERT_TRUE(T->isStringType());
87
88 T = create("int [10]");
89 ASSERT_TRUE(T);
90 ASSERT_TRUE(T->isPointerType());
91 ASSERT_TRUE(T->isFixedLengthArrayPtr());
92
93 T = create("int [P4]");
94 ASSERT_TRUE(T);
95 ASSERT_TRUE(T->isPointerType());
96}
97
98TEST_F(TestType, TypeN) {
99 const std::string Code = "extern \"C\" {\n"

Callers

nothing calls this directly

Calls 15

strToJsonFunction · 0.85
isIntegerTypeMethod · 0.80
isFloatTypeMethod · 0.80
isPointerTypeMethod · 0.80
isNormalPtrMethod · 0.80
isStringTypeMethod · 0.80
isFixedLengthArrayPtrMethod · 0.80
isArrayPtrMethod · 0.80
toStyledStringMethod · 0.80
setGlobalDefMethod · 0.80
getASTTypeNameMethod · 0.80
getNameSpaceMethod · 0.80

Tested by

no test coverage detected