diff options
| author | Philipp Janda <siffiejoe@gmx.net> | 2017-09-18 20:04:24 +0200 |
|---|---|---|
| committer | Hisham Muhammad <hisham@gobolinux.org> | 2017-09-18 15:04:24 -0300 |
| commit | 9cb6834fe07297ba79e7453978cf7e7d8d8c339a (patch) | |
| tree | 0d5f92eafd97efaa43b2c0b67b19c7b44c35d424 /tests/testmod.c | |
| parent | ee2d198f62aeb52751db934a537ee6b0ef164662 (diff) | |
| download | lua-compat-5.3-9cb6834fe07297ba79e7453978cf7e7d8d8c339a.tar.gz lua-compat-5.3-9cb6834fe07297ba79e7453978cf7e7d8d8c339a.tar.bz2 lua-compat-5.3-9cb6834fe07297ba79e7453978cf7e7d8d8c339a.zip | |
Add Travis-CI integration
Diffstat (limited to 'tests/testmod.c')
| -rw-r--r-- | tests/testmod.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/testmod.c b/tests/testmod.c index 1034d20..a0d2e2a 100644 --- a/tests/testmod.c +++ b/tests/testmod.c | |||
| @@ -1,7 +1,5 @@ | |||
| 1 | #include <stdio.h> | 1 | #include <stdio.h> |
| 2 | #include <stdlib.h> | 2 | #include <stdlib.h> |
| 3 | #include <lua.h> | ||
| 4 | #include <lauxlib.h> | ||
| 5 | #include "compat-5.3.h" | 3 | #include "compat-5.3.h" |
| 6 | 4 | ||
| 7 | 5 | ||
| @@ -12,7 +10,7 @@ static int test_isinteger (lua_State *L) { | |||
| 12 | 10 | ||
| 13 | 11 | ||
| 14 | static int test_rotate (lua_State *L) { | 12 | static int test_rotate (lua_State *L) { |
| 15 | int r = luaL_checkint(L, 1); | 13 | int r = (int)luaL_checkinteger(L, 1); |
| 16 | int n = lua_gettop(L)-1; | 14 | int n = lua_gettop(L)-1; |
| 17 | luaL_argcheck(L, (r < 0 ? -r : r) <= n, 1, "not enough arguments"); | 15 | luaL_argcheck(L, (r < 0 ? -r : r) <= n, 1, "not enough arguments"); |
| 18 | lua_rotate(L, 2, r); | 16 | lua_rotate(L, 2, r); |
| @@ -336,6 +334,9 @@ static const luaL_Reg more_funcs[] = { | |||
| 336 | }; | 334 | }; |
| 337 | 335 | ||
| 338 | 336 | ||
| 337 | #ifdef __cplusplus | ||
| 338 | extern "C" { | ||
| 339 | #endif | ||
| 339 | int luaopen_testmod (lua_State *L) { | 340 | int luaopen_testmod (lua_State *L) { |
| 340 | int i = 1; | 341 | int i = 1; |
| 341 | luaL_newlib(L, funcs); | 342 | luaL_newlib(L, funcs); |
| @@ -344,4 +345,7 @@ int luaopen_testmod (lua_State *L) { | |||
| 344 | luaL_setfuncs(L, more_funcs, NUP); | 345 | luaL_setfuncs(L, more_funcs, NUP); |
| 345 | return 1; | 346 | return 1; |
| 346 | } | 347 | } |
| 348 | #ifdef __cplusplus | ||
| 349 | } | ||
| 350 | #endif | ||
| 347 | 351 | ||
