@@ -238,6 +238,16 @@ TEST(FunctionReflectionTest, GetFunctionReturnType) {
238238 int f () { return 0; }
239239 };
240240
241+ void f1() {}
242+ double f2() { return 0.2; }
243+ Switch f3() { return ON; }
244+ N::C f4() { return N::C(); }
245+ N::C *f5() { return new N::C(); }
246+ const N::C f6() { return N::C(); }
247+ volatile N::C f7() { return N::C(); }
248+ const volatile N::C f8() { return N::C(); }
249+ int n;
250+
241251 class MyTemplatedMethodClass {
242252 template<class A>
243253 char get_string(A) {
@@ -252,38 +262,41 @@ TEST(FunctionReflectionTest, GetFunctionReturnType) {
252262 return sizeof(A) + i;
253263 }
254264 };
255-
256- void f1() {}
257- double f2() { return 0.2; }
258- Switch f3() { return ON; }
259- N::C f4() { return N::C(); }
260- N::C *f5() { return new N::C(); }
261- const N::C f6() { return N::C(); }
262- volatile N::C f7() { return N::C(); }
263- const volatile N::C f8() { return N::C(); }
264- int n;
265265 )" ;
266266
267267 GetAllTopLevelDecls (code, Decls, true );
268268 GetAllSubDecls (Decls[2 ], SubDecls);
269- GetAllSubDecls (Decls[3 ], TemplateSubDecls);
269+ GetAllSubDecls (Decls[12 ], TemplateSubDecls);
270270
271271 // #include <string>
272272
273- EXPECT_EQ (Cpp::GetTypeAsString (Cpp::GetFunctionReturnType (Decls[4 ])), " void" );
274- EXPECT_EQ (Cpp::GetTypeAsString (Cpp::GetFunctionReturnType (Decls[5 ])), " double" );
275- EXPECT_EQ (Cpp::GetTypeAsString (Cpp::GetFunctionReturnType (Decls[6 ])), " Switch" );
276- EXPECT_EQ (Cpp::GetTypeAsString (Cpp::GetFunctionReturnType (Decls[7 ])), " N::C" );
277- EXPECT_EQ (Cpp::GetTypeAsString (Cpp::GetFunctionReturnType (Decls[8 ])), " N::C *" );
278- EXPECT_EQ (Cpp::GetTypeAsString (Cpp::GetFunctionReturnType (Decls[9 ])), " const N::C" );
279- EXPECT_EQ (Cpp::GetTypeAsString (Cpp::GetFunctionReturnType (Decls[10 ])), " volatile N::C" );
280- EXPECT_EQ (Cpp::GetTypeAsString (Cpp::GetFunctionReturnType (Decls[11 ])), " const volatile N::C" );
281- EXPECT_EQ (Cpp::GetTypeAsString (Cpp::GetFunctionReturnType (Decls[12 ])), " NULL TYPE" );
273+ EXPECT_EQ (Cpp::GetTypeAsString (Cpp::GetFunctionReturnType (Decls[3 ])), " void" );
274+ EXPECT_EQ (Cpp::GetTypeAsString (Cpp::GetFunctionReturnType (Decls[4 ])),
275+ " double" );
276+ EXPECT_EQ (Cpp::GetTypeAsString (Cpp::GetFunctionReturnType (Decls[5 ])),
277+ " Switch" );
278+ EXPECT_EQ (Cpp::GetTypeAsString (Cpp::GetFunctionReturnType (Decls[6 ])), " N::C" );
279+ EXPECT_EQ (Cpp::GetTypeAsString (Cpp::GetFunctionReturnType (Decls[7 ])),
280+ " N::C *" );
281+ EXPECT_EQ (Cpp::GetTypeAsString (Cpp::GetFunctionReturnType (Decls[8 ])),
282+ " const N::C" );
283+ EXPECT_EQ (Cpp::GetTypeAsString (Cpp::GetFunctionReturnType (Decls[9 ])),
284+ " volatile N::C" );
285+ EXPECT_EQ (Cpp::GetTypeAsString (Cpp::GetFunctionReturnType (Decls[10 ])),
286+ " const volatile N::C" );
287+ EXPECT_EQ (Cpp::GetTypeAsString (Cpp::GetFunctionReturnType (Decls[11 ])),
288+ " NULL TYPE" );
282289 EXPECT_EQ (Cpp::GetTypeAsString (Cpp::GetFunctionReturnType (SubDecls[1 ])), " void" );
283290 EXPECT_EQ (Cpp::GetTypeAsString (Cpp::GetFunctionReturnType (SubDecls[2 ])), " int" );
284- EXPECT_EQ (Cpp::GetTypeAsString (Cpp::GetFunctionReturnType (TemplateSubDecls[1 ])), " char" );
285- EXPECT_EQ (Cpp::GetTypeAsString (Cpp::GetFunctionReturnType (TemplateSubDecls[2 ])), " void" );
286- EXPECT_EQ (Cpp::GetTypeAsString (Cpp::GetFunctionReturnType (TemplateSubDecls[3 ])), " long" );
291+ EXPECT_EQ (
292+ Cpp::GetTypeAsString (Cpp::GetFunctionReturnType (TemplateSubDecls[1 ])),
293+ " char" );
294+ EXPECT_EQ (
295+ Cpp::GetTypeAsString (Cpp::GetFunctionReturnType (TemplateSubDecls[2 ])),
296+ " void" );
297+ EXPECT_EQ (
298+ Cpp::GetTypeAsString (Cpp::GetFunctionReturnType (TemplateSubDecls[3 ])),
299+ " long" );
287300}
288301
289302TEST (FunctionReflectionTest, GetFunctionNumArgs) {
0 commit comments