2022-03-03 16:04:57 +00:00
|
|
|
#include <gtest/gtest.h>
|
2022-11-10 04:43:23 +00:00
|
|
|
#include "syncTest.h"
|
2022-03-02 07:11:54 +00:00
|
|
|
|
|
|
|
|
void logTest() {
|
|
|
|
|
sTrace("--- sync log test: trace");
|
|
|
|
|
sDebug("--- sync log test: debug");
|
|
|
|
|
sInfo("--- sync log test: info");
|
|
|
|
|
sWarn("--- sync log test: warn");
|
|
|
|
|
sError("--- sync log test: error");
|
|
|
|
|
sFatal("--- sync log test: fatal");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
|
// taosInitLog((char *)"syncTest.log", 100000, 10);
|
|
|
|
|
tsAsyncLog = 0;
|
|
|
|
|
sDebugFlag = 143 + 64;
|
|
|
|
|
|
|
|
|
|
logTest();
|
|
|
|
|
|
|
|
|
|
int32_t ret;
|
|
|
|
|
|
|
|
|
|
ret = syncIOStart((char*)"127.0.0.1", 7010);
|
2025-04-10 08:52:55 +00:00
|
|
|
TD_ALWAYS_ASSERT(ret == 0);
|
2022-03-02 07:11:54 +00:00
|
|
|
|
2022-03-12 09:02:15 +00:00
|
|
|
for (int i = 0; i < 3; ++i) {
|
|
|
|
|
ret = syncIOQTimerStart();
|
2025-04-10 08:52:55 +00:00
|
|
|
TD_ALWAYS_ASSERT(ret == 0);
|
2022-03-12 09:02:15 +00:00
|
|
|
taosMsleep(5000);
|
2022-03-02 07:11:54 +00:00
|
|
|
|
2022-03-12 09:02:15 +00:00
|
|
|
ret = syncIOQTimerStop();
|
2025-04-10 08:52:55 +00:00
|
|
|
TD_ALWAYS_ASSERT(ret == 0);
|
2022-03-12 09:02:15 +00:00
|
|
|
taosMsleep(5000);
|
2022-03-02 07:11:54 +00:00
|
|
|
}
|
2022-03-12 09:02:15 +00:00
|
|
|
|
|
|
|
|
ret = syncIOStop();
|
2025-04-10 08:52:55 +00:00
|
|
|
TD_ALWAYS_ASSERT(ret == 0);
|
2022-03-12 09:02:15 +00:00
|
|
|
|
2022-03-02 07:11:54 +00:00
|
|
|
return 0;
|
|
|
|
|
}
|