Unverified Commit e725d737 authored by sundb's avatar sundb Committed by GitHub
Browse files

Add --large-memory flag for REDIS_TEST to enable tests that consume more than 100mb (#9784)

This is a preparation step in order to add a new test in quicklist.c see #9776
parent aba70df4
......@@ -1688,6 +1688,7 @@ unsigned int ziplistRandomPairsUnique(unsigned char *zl, unsigned int count, zip
#include <sys/time.h>
#include "adlist.h"
#include "sds.h"
#include "testhelp.h"
#define debug(f, ...) { if (DEBUG) printf(f, __VA_ARGS__); }
......@@ -1842,8 +1843,9 @@ static size_t strEntryBytesLarge(size_t slen) {
return slen + zipStorePrevEntryLength(NULL, ZIP_BIG_PREVLEN) + zipStoreEntryEncoding(NULL, 0, slen);
}
/* ./redis-server test ziplist <randomseed> --accurate */
int ziplistTest(int argc, char **argv, int accurate) {
/* ./redis-server test ziplist <randomseed> */
int ziplistTest(int argc, char **argv, int flags) {
int accurate = (flags & REDIS_TEST_ACCURATE);
unsigned char *zl, *p;
unsigned char *entry;
unsigned int elen;
......
......@@ -68,7 +68,7 @@ unsigned int ziplistRandomPairsUnique(unsigned char *zl, unsigned int count, zip
int ziplistSafeToAdd(unsigned char* zl, size_t add);
#ifdef REDIS_TEST
int ziplistTest(int argc, char *argv[], int accurate);
int ziplistTest(int argc, char *argv[], int flags);
#endif
#endif /* _ZIPLIST_H */
......@@ -476,12 +476,12 @@ static void zipmapRepr(unsigned char *p) {
}
#define UNUSED(x) (void)(x)
int zipmapTest(int argc, char *argv[], int accurate) {
int zipmapTest(int argc, char *argv[], int flags) {
unsigned char *zm;
UNUSED(argc);
UNUSED(argv);
UNUSED(accurate);
UNUSED(flags);
zm = zipmapNew();
......
......@@ -48,7 +48,7 @@ void zipmapRepr(unsigned char *p);
int zipmapValidateIntegrity(unsigned char *zm, size_t size, int deep);
#ifdef REDIS_TEST
int zipmapTest(int argc, char *argv[], int accurate);
int zipmapTest(int argc, char *argv[], int flags);
#endif
#endif
......@@ -712,12 +712,12 @@ size_t zmalloc_get_memory_size(void) {
#ifdef REDIS_TEST
#define UNUSED(x) ((void)(x))
int zmalloc_test(int argc, char **argv, int accurate) {
int zmalloc_test(int argc, char **argv, int flags) {
void *ptr;
UNUSED(argc);
UNUSED(argv);
UNUSED(accurate);
UNUSED(flags);
printf("Malloc prefix size: %d\n", (int) PREFIX_SIZE);
printf("Initial used memory: %zu\n", zmalloc_used_memory());
ptr = zmalloc(123);
......
......@@ -136,7 +136,7 @@ size_t zmalloc_usable_size(void *ptr);
#endif
#ifdef REDIS_TEST
int zmalloc_test(int argc, char **argv, int accurate);
int zmalloc_test(int argc, char **argv, int flags);
#endif
#endif /* __ZMALLOC_H */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment