Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
1d7c0e59
Commit
1d7c0e59
authored
Jun 24, 2021
by
Oran Agra
Browse files
Fix failing basics moduleapi test on 32bit CI (#9140)
(cherry picked from commit
5ffdbae1
)
parent
37b0f361
Changes
2
Hide whitespace changes
Inline
Side-by-side
tests/modules/basics.c
View file @
1d7c0e59
...
@@ -333,6 +333,9 @@ int TestCtxFlags(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) {
...
@@ -333,6 +333,9 @@ int TestCtxFlags(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) {
flags
=
RedisModule_GetContextFlags
(
ctx
);
flags
=
RedisModule_GetContextFlags
(
ctx
);
if
(
!
(
flags
&
REDISMODULE_CTX_FLAGS_AOF
))
FAIL
(
"AOF Flag not set after config set"
);
if
(
!
(
flags
&
REDISMODULE_CTX_FLAGS_AOF
))
FAIL
(
"AOF Flag not set after config set"
);
/* Disable RDB saving and test the flag. */
RedisModule_Call
(
ctx
,
"config"
,
"ccc"
,
"set"
,
"save"
,
""
);
flags
=
RedisModule_GetContextFlags
(
ctx
);
if
(
flags
&
REDISMODULE_CTX_FLAGS_RDB
)
FAIL
(
"RDB Flag was set"
);
if
(
flags
&
REDISMODULE_CTX_FLAGS_RDB
)
FAIL
(
"RDB Flag was set"
);
/* Enable RDB to test RDB flags */
/* Enable RDB to test RDB flags */
RedisModule_Call
(
ctx
,
"config"
,
"ccc"
,
"set"
,
"save"
,
"900 1"
);
RedisModule_Call
(
ctx
,
"config"
,
"ccc"
,
"set"
,
"save"
,
"900 1"
);
...
@@ -344,8 +347,12 @@ int TestCtxFlags(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) {
...
@@ -344,8 +347,12 @@ int TestCtxFlags(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) {
if
(
flags
&
REDISMODULE_CTX_FLAGS_READONLY
)
FAIL
(
"Read-only flag was set"
);
if
(
flags
&
REDISMODULE_CTX_FLAGS_READONLY
)
FAIL
(
"Read-only flag was set"
);
if
(
flags
&
REDISMODULE_CTX_FLAGS_CLUSTER
)
FAIL
(
"Cluster flag was set"
);
if
(
flags
&
REDISMODULE_CTX_FLAGS_CLUSTER
)
FAIL
(
"Cluster flag was set"
);
/* Disable maxmemory and test the flag. (it is implicitly set in 32bit builds. */
RedisModule_Call
(
ctx
,
"config"
,
"ccc"
,
"set"
,
"maxmemory"
,
"0"
);
flags
=
RedisModule_GetContextFlags
(
ctx
);
if
(
flags
&
REDISMODULE_CTX_FLAGS_MAXMEMORY
)
FAIL
(
"Maxmemory flag was set"
);
if
(
flags
&
REDISMODULE_CTX_FLAGS_MAXMEMORY
)
FAIL
(
"Maxmemory flag was set"
);
/* Enable maxmemory and test the flag. */
RedisModule_Call
(
ctx
,
"config"
,
"ccc"
,
"set"
,
"maxmemory"
,
"100000000"
);
RedisModule_Call
(
ctx
,
"config"
,
"ccc"
,
"set"
,
"maxmemory"
,
"100000000"
);
flags
=
RedisModule_GetContextFlags
(
ctx
);
flags
=
RedisModule_GetContextFlags
(
ctx
);
if
(
!
(
flags
&
REDISMODULE_CTX_FLAGS_MAXMEMORY
))
if
(
!
(
flags
&
REDISMODULE_CTX_FLAGS_MAXMEMORY
))
...
...
tests/unit/moduleapi/basics.tcl
View file @
1d7c0e59
set testmodule
[
file normalize tests/modules/basics.so
]
set testmodule
[
file normalize tests/modules/basics.so
]
# TEST.CTXFLAGS requires RDB to be disabled, so override save file
start_server
{
tags
{
"modules"
}}
{
start_server
{
tags
{
"modules"
}
overrides
{
save
""
}}
{
r module load $testmodule
r module load $testmodule
test
{
test module api basics
}
{
test
{
test module api basics
}
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment