Merge: Basename fix
[nit.git] / tests / test_ffi_c_types.nit
index 9391d7c..7607127 100644 (file)
@@ -8,7 +8,7 @@ in "C header" `{
                };
 `}
 
-extern A in "C" `{struct s_a*`}
+extern class A in "C" `{struct s_a*`}
        new `{
                struct s_a* v = malloc(sizeof(struct s_a));
                v->x = 1;
@@ -16,11 +16,11 @@ extern A in "C" `{struct s_a*`}
                return v;
        `}
        fun p `{
-               printf( "A< %d %d >\n", recv->x, recv->y );
+               printf( "A< %d %d >\n", self->x, self->y );
        `}
 end
 
-extern B in "C" `{struct s_b*`}
+extern class B in "C" `{struct s_b*`}
        super A
        new `{
                struct s_b* v = malloc(sizeof(struct s_b));
@@ -32,12 +32,12 @@ extern B in "C" `{struct s_b*`}
        `}
        redef fun p import super `{
                printf( "B< " );
-               B_p___super(recv);
-               printf( "   %d %d >\n", recv->w, recv->h );
+               B_p___super(self);
+               printf( "   %d %d >\n", self->w, self->h );
        `}
 end
 
-extern C
+extern class C
        super A
        new `{
                struct s_a* v = malloc(sizeof(struct s_a));
@@ -46,7 +46,7 @@ extern C
                return v;
        `}
        redef fun p `{
-               printf( "C< %d %d >\n", recv->x, recv->y );
+               printf( "C< %d %d >\n", self->x, self->y );
        `}
 end