test-ffi-wrapper: c-peek-cstring can now return a legacy string.
authorMatt Birkholz <matt@birchwood-abbey.net>
Tue, 23 May 2017 23:43:28 +0000 (16:43 -0700)
committerMatt Birkholz <matt@birchwood-abbey.net>
Tue, 23 May 2017 23:43:28 +0000 (16:43 -0700)
tests/ffi/test-ffi-wrapper.scm

index 193ba762c9834218acf9195c7a124b5a07a7975f..746adb325d0839d4b3effc1544aaaee43d9fdef3 100644 (file)
@@ -37,7 +37,9 @@
                                           bytevector struct))))
                         (new (c-peek-cstring alien)))
                    (free alien)
-                   (utf8->string new)))
+                   (if (string? new)
+                       new
+                       (utf8->string new))))
     (let ((a (C-call "test_struct" struct struct)))
       (assert-equal a struct)
       (assert-equal (C-> a "TestStruct second")