@@ -24,11 +24,11 @@ TEST_CASE("native types", "[Type]" ) {
24
24
{" short" , " native.CShort" },
25
25
{" unsigned short" , " native.CUnsignedShort" },
26
26
{" int" , " native.CInt" },
27
- // {"long int", "native.CLongInt"},
28
- {" unsigned int" , " native.CUnsignedInt" },
29
- // {"unsigned long int", "native.CUnsignedLongInt"},
30
27
{" long" , " native.CLong" },
28
+ // {"long int", "native.CLongInt"}, <- similar to a long, why is it different ?
29
+ {" unsigned int" , " native.CUnsignedInt" },
31
30
{" unsigned long" , " native.CUnsignedLong" },
31
+ // {"unsigned long int", "native.CUnsignedLongInt"}, <- similar to an unsigned long why is it different ?
32
32
{" long long" , " native.CLongLong" },
33
33
{" unsigned long long" , " native.CUnsignedLongLong" },
34
34
{" size_t" , " native.CSize" },
@@ -40,9 +40,7 @@ TEST_CASE("native types", "[Type]" ) {
40
40
{" double" , " native.CDouble" },
41
41
{" void*" , " native.Ptr[Byte]" },
42
42
{" int*" , " native.Ptr[native.CInt]" },
43
- // {"char*", "native.CString"},
44
- // {"int (*a)(int)", "native.CFunctionPtr1[native.CInt, native.CInt]"},
45
- // {"struct { int x, y; }*", "native.Ptr[native.CStruct2[native.CInt, native.CInt]]"}
43
+ {" char*" , " native.CString" },
46
44
};
47
45
48
46
for (const auto & kv: types){
@@ -52,3 +50,10 @@ TEST_CASE("native types", "[Type]" ) {
52
50
REQUIRE (answer == Translate (code));
53
51
}
54
52
}
53
+
54
+ TEST_CASE (" native types function pointer" , " [Type]" ){
55
+ std::string code = " typedef int (*a)(int);" ;
56
+ std::string answ = " \t type a = native.CFunctionPtr1[native.CInt, native.CInt]\n " ;
57
+ REQUIRE (answ == Translate (code));
58
+ }
59
+
0 commit comments