MCPcopy Create free account
hub / github.com/MonaSolutions/MonaServer / Test

Method Test

MonaServer/sources/Script.cpp:520–553  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

518
519
520void Script::Test(lua_State* pState) {
521 int i;
522 int top = lua_gettop(pState);
523
524 printf("total in stack %d\n", top);
525
526 for (i = 1; i <= top; i++) { /* repeat for each level */
527 int t = lua_type(pState, i);
528 switch (t) {
529
530 case LUA_TNONE: /* strings */
531 printf("none\n");
532 break;
533 case LUA_TNIL: /* strings */
534 printf("nil\n");
535 break;
536 case LUA_TSTRING: /* strings */
537 printf("string: '%s'\n", lua_tostring(pState, i));
538 break;
539 case LUA_TBOOLEAN: /* booleans */
540 printf("boolean %s\n", lua_toboolean(pState, i) ? "true" : "false");
541 break;
542 case LUA_TNUMBER: /* numbers */
543 printf("number: %g\n", lua_tonumber(pState, i));
544 break;
545 default: /* other values */
546 printf("%s: %p\n", lua_typename(pState, t),lua_topointer(pState,i));
547 break;
548 }
549 printf(" "); /* put a separator */
550 }
551 printf("\n"); /* end the listing */
552
553}
554

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected