Skip to content

Commit

Permalink
Remove REDIS tag from test macros. (#333)
Browse files Browse the repository at this point in the history
Signed-off-by: Shivshankar-Reddy <shiva.sheri.github@gmail.com>
  • Loading branch information
Shivshankar-Reddy committed Apr 19, 2024
1 parent cc94c98 commit 7809df0
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/dict.c
Original file line number Diff line number Diff line change
Expand Up @@ -1817,7 +1817,7 @@ int dictTest(int argc, char **argv, int flags) {
dict *dict = dictCreate(&BenchmarkDictType);
long count = 0;
unsigned long new_dict_size, current_dict_used, remain_keys;
int accurate = (flags & REDIS_TEST_ACCURATE);
int accurate = (flags & TEST_ACCURATE);

if (argc == 4) {
if (accurate) {
Expand Down
2 changes: 1 addition & 1 deletion src/listpack.c
Original file line number Diff line number Diff line change
Expand Up @@ -1817,7 +1817,7 @@ int listpackTest(int argc, char *argv[], int flags) {
unsigned char *lp, *p, *vstr;
int64_t vlen;
unsigned char intbuf[LP_INTBUF_SIZE];
int accurate = (flags & REDIS_TEST_ACCURATE);
int accurate = (flags & TEST_ACCURATE);

TEST("Create int list") {
lp = createIntList();
Expand Down
4 changes: 2 additions & 2 deletions src/quicklist.c
Original file line number Diff line number Diff line change
Expand Up @@ -2019,7 +2019,7 @@ int quicklistTest(int argc, char *argv[], int flags) {
UNUSED(argc);
UNUSED(argv);

int accurate = (flags & REDIS_TEST_ACCURATE);
int accurate = (flags & TEST_ACCURATE);
unsigned int err = 0;
int optimize_start =
-(int)(sizeof(optimization_level) / sizeof(*optimization_level));
Expand Down Expand Up @@ -3259,7 +3259,7 @@ int quicklistTest(int argc, char *argv[], int flags) {
quicklistRelease(ql);
}

if (flags & REDIS_TEST_LARGE_MEMORY) {
if (flags & TEST_LARGE_MEMORY) {
TEST("compress and decompress quicklist listpack node") {
quicklistNode *node = quicklistCreateNode();
node->entry = lpNew(0);
Expand Down
6 changes: 3 additions & 3 deletions src/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -6928,9 +6928,9 @@ int main(int argc, char **argv) {
int flags = 0;
for (j = 3; j < argc; j++) {
char *arg = argv[j];
if (!strcasecmp(arg, "--accurate")) flags |= REDIS_TEST_ACCURATE;
else if (!strcasecmp(arg, "--large-memory")) flags |= REDIS_TEST_LARGE_MEMORY;
else if (!strcasecmp(arg, "--valgrind")) flags |= REDIS_TEST_VALGRIND;
if (!strcasecmp(arg, "--accurate")) flags |= TEST_ACCURATE;
else if (!strcasecmp(arg, "--large-memory")) flags |= TEST_LARGE_MEMORY;
else if (!strcasecmp(arg, "--valgrind")) flags |= TEST_VALGRIND;
}

if (!strcasecmp(argv[2], "all")) {
Expand Down
6 changes: 3 additions & 3 deletions src/testhelp.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
#ifndef __TESTHELP_H
#define __TESTHELP_H

#define REDIS_TEST_ACCURATE (1<<0)
#define REDIS_TEST_LARGE_MEMORY (1<<1)
#define REDIS_TEST_VALGRIND (1<<2)
#define TEST_ACCURATE (1<<0)
#define TEST_LARGE_MEMORY (1<<1)
#define TEST_VALGRIND (1<<2)

extern int __failed_tests;
extern int __test_num;
Expand Down
2 changes: 1 addition & 1 deletion src/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -1646,7 +1646,7 @@ int utilTest(int argc, char **argv, int flags) {
test_ld2string();
test_fixedpoint_d2string();
#if defined(__linux__)
if (!(flags & REDIS_TEST_VALGRIND)) {
if (!(flags & TEST_VALGRIND)) {
test_reclaimFilePageCache();
}
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/ziplist.c
Original file line number Diff line number Diff line change
Expand Up @@ -1847,7 +1847,7 @@ static size_t strEntryBytesLarge(size_t slen) {

/* ./redis-server test ziplist <randomseed> */
int ziplistTest(int argc, char **argv, int flags) {
int accurate = (flags & REDIS_TEST_ACCURATE);
int accurate = (flags & TEST_ACCURATE);
unsigned char *zl, *p;
unsigned char *entry;
unsigned int elen;
Expand Down

0 comments on commit 7809df0

Please sign in to comment.