X-Git-Url: http://nitlanguage.org diff --git a/tests/string_ffi_ref_test.nit b/tests/string_ffi_ref_test.nit index 64b6bc4..56461e1 100644 --- a/tests/string_ffi_ref_test.nit +++ b/tests/string_ffi_ref_test.nit @@ -16,33 +16,27 @@ module string_ffi_ref_test -intrude import string +intrude import text::flat import file class StringTest - var copied_str: nullable String + var copied_str: nullable String = null - var referenced_str: nullable String + var referenced_str: nullable String = null - init - do - copied_str = null - referenced_str = null - end - - fun get_c_string import String.items, NativeString.to_s, NativeString.to_s_with_copy, StringTest.ref_test, StringTest.copy_test `{ + fun get_c_string import FlatString.items, CString.to_s, CString.to_s, StringTest.ref_test, StringTest.copy_test `{ char* string = "This is a test string"; - String ref_string = NativeString_to_s(string); - StringTest_ref_test(recv, ref_string); + FlatString ref_string = CString_to_s(string); + StringTest_ref_test(self, ref_string); - String copy_string = NativeString_to_s_with_copy(string); - StringTest_copy_test(recv, copy_string); + FlatString copy_string = CString_to_s(string); + StringTest_copy_test(self, copy_string); - int same_refs = String_items(copy_string) == String_items(ref_string); + int same_refs = FlatString_items(copy_string) == FlatString_items(ref_string); - printf("Do the strings have the same NativeString reference ? "); + printf("Do the strings have the same CString reference ? "); if(same_refs){ printf("True\n");