redict/tests/unit/moduleapi
Oran Agra f1f3cceb50
fix valgrind issues with long double module test (#9709)
The module test in reply.tcl was introduced by #8521 but didn't run until recently (see #9639)
and then it started failing with valgrind.
This is because valgrind uses 64 bit long double (unlike most other platforms that have at least 80 bits)
But besides valgrind, the tests where also incompatible with ARM32, which also uses 64 bit long doubles.

We now use appropriate value to avoid issues with either valgrind or ARM32

In all the double tests, i use 3.141, which is safe since since addReplyDouble uses
`%.17Lg` which is able to represent this value without adding any digits due to precision loss. 

In the long double, since we use `%.17Lf` in ld2string, it preserves 17 significant
digits, rather than 17 digit after the decimal point (like in `%.17Lg`).
So to make these similar, i use value lower than 1 (no digits left of
the period)

Lastly, we have the same issue with TCL (no long doubles) so we read
raw protocol in that test.

Note that the only error before this fix (in both valgrind and ARM32 is this:
```
*** [err]: RM_ReplyWithLongDouble: a float reply in tests/unit/moduleapi/reply.tcl
Expected '3.141' to be equal to '3.14100000000000001' (context: type eval line 2 cmd {assert_equal 3.141 [r rw.longdouble 3.141]} proc ::test)
```
so the changes to debug.c and scripting.tcl aren't really needed, but i consider them a cleanup
(i.e. scripting.c validated a different constant than the one that's sent to it from debug.c).

Another unrelated change is to add the RESP version to the repeated tests in reply.tcl
2021-11-01 13:41:35 +02:00
..
aclcheck.tcl Adding ACL support for modules (#9309) 2021-09-23 08:52:56 +03:00
auth.tcl Fixed some typos, add a spell check ci and others minor fix (#8890) 2021-06-10 15:39:33 +03:00
basics.tcl Unified Lua and modules reply parsing and added RESP3 support to RM_Call (#9202) 2021-08-04 16:28:07 +03:00
blockedclient.tcl Fix module blocked clients RESP version (#9634) 2021-10-21 14:01:10 +03:00
blockonbackground.tcl Fix CLIENT UNBLOCK crashing modules. (#9167) 2021-07-01 17:11:27 +03:00
blockonkeys.tcl Test that module can wake up module blocked on non-empty list key (#8382) 2021-01-22 16:19:37 +02:00
cluster.tcl fix new cluster tests issues (#9657) 2021-10-20 15:40:28 +03:00
commandfilter.tcl Remove const from CommandFilterArgGet result (#9247) 2021-08-01 11:29:32 +03:00
datatype2.tcl Enhance mem_usage/free_effort/unlink/copy callbacks and add GetDbFromIO api. (#8999) 2021-06-16 09:45:49 +03:00
datatype.tcl Modules: add RM_LoadDataTypeFromStringEncver (#9537) 2021-09-30 11:21:32 +03:00
defrag.tcl Tests: fix new defrag test to be skipped when not supported (#8185) 2020-12-14 11:13:46 +02:00
fork.tcl tests: fix exec fails when grep exists with status other than 0 (#9066) 2021-07-25 09:58:21 +03:00
getkeys.tcl Modules: add RM_GetCommandKeys(). 2020-10-11 16:04:14 +03:00
hash.tcl Modules: In RM_HashSet, add COUNT_ALL flag and set errno (#8446) 2021-02-15 11:40:05 +02:00
hooks.tcl Add Swapdb Module Event (#7804) 2020-09-20 13:36:20 +03:00
infotest.tcl Escape unsafe field name characters in INFO. (#8492) 2021-02-15 17:08:53 +02:00
infra.tcl add test for modules load/unload and config rewrite 2021-06-01 13:43:48 +03:00
keyspace_events.tcl Modules: adding a module type for key space notification (#8759) 2021-04-19 21:33:26 +03:00
keyspecs.tcl Treat subcommands as commands (#9504) 2021-10-20 11:52:57 +03:00
list.tcl Modules: Add remaining list API functions (#8439) 2021-09-14 17:48:06 +03:00
misc.tcl Add RedisModule_KeyExists (#9600) 2021-10-18 22:21:19 +03:00
propagate.tcl Modules: Replicate lazy-expire even if replication is not allowed (#8816) 2021-04-19 17:16:02 +03:00
reply.tcl fix valgrind issues with long double module test (#9709) 2021-11-01 13:41:35 +02:00
scan.tcl Fix RM_ScanKey module api not to return int encoded strings 2020-06-14 11:20:15 +03:00
stream.tcl Add modules API for streams (#8288) 2021-01-28 16:19:43 +02:00
subcommands.tcl Treat subcommands as commands (#9504) 2021-10-20 11:52:57 +03:00
test_lazyfree.tcl Modules callbacks for lazy free effort, and unlink (#7912) 2020-11-16 10:34:04 +02:00
testrdb.tcl Replication backlog and replicas use one global shared replication buffer (#9166) 2021-10-25 09:24:31 +03:00
timer.tcl Add timer module API tests. (#8041) 2020-11-11 22:57:33 +02:00
zset.tcl RM_ZsetRem: Delete key if empty (#8453) 2021-02-05 19:54:01 +02:00