Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Test for int64 as native call return type.
  • Loading branch information
jnthn committed Apr 4, 2015
1 parent 5692768 commit 6b27502
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
7 changes: 7 additions & 0 deletions t/04-nativecall/03-simple-returns.c
Expand Up @@ -3,8 +3,10 @@

#ifdef WIN32
#define DLLEXPORT __declspec(dllexport)
typedef signed __int64 int64_t;
#else
#define DLLEXPORT extern
#include <inttypes.h>
#endif

DLLEXPORT int ReturnInt()
Expand Down Expand Up @@ -41,3 +43,8 @@ DLLEXPORT char * ReturnNullString()
{
return NULL;
}

DLLEXPORT int64_t ReturnInt64()
{
return 0xFFFFFFFFFF;
}
5 changes: 4 additions & 1 deletion t/04-nativecall/03-simple-returns.t
Expand Up @@ -4,7 +4,7 @@ use lib 'lib';
use NativeCall;
use Test;

plan(7);
plan(8);

compile_test_lib('03-simple-returns');

Expand All @@ -28,3 +28,6 @@ is ReturnString(), "epic cuteness", 'returning string works';

sub ReturnNullString returns Str is native('./03-simple-returns') { * }
nok ReturnNullString().defined, 'returning null string pointer';

sub ReturnInt64() returns int64 is native('./03-simple-returns') { * }
is ReturnInt64(), 0xFFFFFFFFFF, 'returning int64 works';

0 comments on commit 6b27502

Please sign in to comment.