tests: fix missing code in test_ffi_c_callback_extern_receiver
authorAlexis Laferrière <alexis.laf@xymus.net>
Thu, 13 Jun 2013 14:35:23 +0000 (10:35 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Fri, 2 Aug 2013 17:52:36 +0000 (13:52 -0400)
Some C includes and Nit callbacks were missing.

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

tests/test_ffi_c_callback_extern_receiver.nit

index 25d456f..7299f4a 100644 (file)
 # tests for a recurring bug when callbacking a Nit method on an extern receiver 
 module test_ffi_c_callback_extern_receiver
 
+`{
+#include <stdio.h>
+`}
+
 extern Test
     new create_me is extern `{
         int* foobar = malloc(sizeof(int));
         *foobar = 12345;
         return foobar;
     `}
-    fun test_me is extern import Test::foo `{
+
+    fun test_me is extern import Test::foo, String::from_cstring `{
         int i;
         for(i = 0; i < 2000; ++i) {
             printf("%d\n", i);
             Test_foo(recv, new_String_from_cstring("asdf"));
         }
     `}
+
     fun foo(bar : String) do
         print bar
     end
 end
+
 var t = new Test.create_me
 t.test_me