Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Some struct test updates.

  • Loading branch information...
commit 849081869bb9e4145e57b561d88c6d212228e5ae 1 parent 2a01379
@arnsholt arnsholt authored
Showing with 5 additions and 4 deletions.
  1. +3 −3 t/06-struct.c
  2. +2 −1  t/06-struct.t
View
6 t/06-struct.c
@@ -9,9 +9,9 @@
#endif
typedef struct {
- int intval;
+ long intval;
double numval;
- int *arr;
+ long *arr;
} MyStruct;
DLLEXPORT MyStruct *ReturnAStruct()
@@ -19,7 +19,7 @@ DLLEXPORT MyStruct *ReturnAStruct()
MyStruct *obj = (MyStruct *) malloc(sizeof(MyStruct));
obj->intval = 17;
obj->numval = 4.2;
- obj->arr = (int *) malloc(3*sizeof(int));
+ obj->arr = (long *) malloc(3*sizeof(long));
obj->arr[0] = 2;
obj->arr[1] = 3;
obj->arr[2] = 5;
View
3  t/06-struct.t
@@ -2,7 +2,7 @@ use t::CompileTestLib;
use NativeCall;
use Test;
-plan 7;
+plan 12;
compile_test_lib('06-struct');
@@ -43,6 +43,7 @@ is $obj.arr[1], 2, 'getting CArray and element';
# C-side tests:
# NYI:
+skip('NYI: Getting struct from C-land', 5);
#my $cobj = ReturnAStruct;
#
#is $cobj.int, 17, 'getting int from C-created struct';
Please sign in to comment.
Something went wrong with that request. Please try again.