openresty / lua-cjson

Lua CJSON is a fast JSON encoding/parsing module for Lua
http://www.kyne.com.au/~mark/software/lua-cjson.php
MIT License
436 stars 119 forks source link

new features' tests can't pass in ARM, but basic cases is OK #61

Closed NagamineLee closed 2 years ago

NagamineLee commented 4 years ago

OS: centos-7.6 ARCH: aarch64(ARM)

tests/agentzh.t .. 1/40 
#   Failed test 'TEST 4: empty_array userdata - output ok'
#   at /DATA/yfli1/test/upngx-test/lua-cjson-test/tests/TestLua.pm line 58.
#          got: '{"arr":}
# '
#     expected: '{"arr":[]}
# '

#   Failed test 'TEST 7: empty_array_mt and empty tables as objects (explicit) - output ok'
#   at /DATA/yfli1/test/upngx-test/lua-cjson-test/tests/TestLua.pm line 58.
#          got: '{"foo":{"foobar":{"obj":{},"arr":},"obj":{}},"arr":[]}
# '
#     expected: '{"foo":{"foobar":{"obj":{},"arr":[]},"obj":{}},"arr":[]}
# '

#   Failed test 'TEST 8: empty_array_mt on non-empty tables - output ok'
#   at /DATA/yfli1/test/upngx-test/lua-cjson-test/tests/TestLua.pm line 58.
#          got: '{"foo":{"foobar":{"obj":{},"arr":},"obj":{}},"arr":["hello","world","lua"]}
# '
#     expected: '{"foo":{"foobar":{"obj":{},"arr":[]},"obj":{}},"arr":["hello","world","lua"]}
# '
# Looks like you failed 3 tests of 40.
tests/agentzh.t .. Dubious, test returned 3 (wstat 768, 0x300)
Failed 3/40 subtests 

when running on LuaJIT, a warning occurs:

Testing Lua CJSON version 2.1.0.6
lua: lj_gc.c:824: lj_mem_realloc: Assertion `(1 ? (((uint64_t)(uintptr_t)((p)) >> 47) == 0) : 1 ? ((uintptr_t)((p)) == (uint32_t)(uintptr_t)((p))) :1)' failed.

but not affect test.

dndx commented 2 years ago

Fixed in https://github.com/openresty/lua-cjson/pull/82.