From a6f1583f8132c933b731916d472867590a5aee0d Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Sat, 15 Aug 2020 13:33:58 +0800 Subject: [PATCH] move macro definition position for random test. --- src/tsdb/src/tsdbFile.c | 5 +++-- src/tsdb/src/tsdbRWHelper.c | 6 ++++-- src/util/src/tkvstore.c | 4 +++- src/wal/src/walMain.c | 4 +++- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/tsdb/src/tsdbFile.c b/src/tsdb/src/tsdbFile.c index 8bc4be6d67..d960dfb7ba 100644 --- a/src/tsdb/src/tsdbFile.c +++ b/src/tsdb/src/tsdbFile.c @@ -15,13 +15,14 @@ #define _DEFAULT_SOURCE #include +#define TAOS_RANDOM_FILE_FAIL_TEST + #include "os.h" #include "talgo.h" #include "tchecksum.h" #include "tsdbMain.h" #include "tutil.h" -#define TAOS_RANDOM_FILE_FAIL_TEST const char *tsdbFileSuffix[] = {".head", ".data", ".last", ".stat", ".h", ".d", ".l", ".s"}; @@ -529,4 +530,4 @@ static void tsdbInitFileGroup(SFileGroup *pFGroup, STsdbRepo *pRepo) { terrno = TSDB_CODE_TDB_FILE_CORRUPTED; } } -} \ No newline at end of file +} diff --git a/src/tsdb/src/tsdbRWHelper.c b/src/tsdb/src/tsdbRWHelper.c index ed851a08c2..12199f491f 100644 --- a/src/tsdb/src/tsdbRWHelper.c +++ b/src/tsdb/src/tsdbRWHelper.c @@ -14,13 +14,15 @@ */ #define _DEFAULT_SOURCE + +#define TAOS_RANDOM_FILE_FAIL_TEST + #include "os.h" #include "talgo.h" #include "tchecksum.h" #include "tcoding.h" #include "tscompression.h" #include "tsdbMain.h" -#define TAOS_RANDOM_FILE_FAIL_TEST #define TSDB_GET_COMPCOL_LEN(nCols) (sizeof(SCompData) + sizeof(SCompCol) * (nCols) + sizeof(TSCKSUM)) #define TSDB_KEY_COL_OFFSET 0 @@ -1651,4 +1653,4 @@ static int tsdbWriteBlockToProperFile(SRWHelper *pHelper, SDataCols *pDataCols, if (tsdbWriteBlockToFile(pHelper, pFile, pDataCols, pCompBlock, isLast, true) < 0) return -1; return 0; -} \ No newline at end of file +} diff --git a/src/util/src/tkvstore.c b/src/util/src/tkvstore.c index dd0600ec3c..9fab4a5936 100644 --- a/src/util/src/tkvstore.c +++ b/src/util/src/tkvstore.c @@ -14,6 +14,9 @@ */ #define _DEFAULT_SOURCE + +#define TAOS_RANDOM_FILE_FAIL_TEST + #include "os.h" #include "hash.h" #include "taoserror.h" @@ -21,7 +24,6 @@ #include "tcoding.h" #include "tkvstore.h" #include "tulog.h" -#define TAOS_RANDOM_FILE_FAIL_TEST #define TD_KVSTORE_HEADER_SIZE 512 #define TD_KVSTORE_MAJOR_VERSION 1 diff --git a/src/wal/src/walMain.c b/src/wal/src/walMain.c index 4ac8a096c6..bebad69f32 100644 --- a/src/wal/src/walMain.c +++ b/src/wal/src/walMain.c @@ -14,6 +14,9 @@ */ #define _DEFAULT_SOURCE + +#define TAOS_RANDOM_FILE_FAIL_TEST + #include "os.h" #include "tlog.h" #include "tchecksum.h" @@ -22,7 +25,6 @@ #include "taoserror.h" #include "twal.h" #include "tqueue.h" -#define TAOS_RANDOM_FILE_FAIL_TEST #define walPrefix "wal" -- GitLab