syncIOTickPingTest.cpp 745 字节
Newer Older
1
#include <gtest/gtest.h>
2
#include "syncTest.h"
M
sync io  
Minghao Li 已提交
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

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);
  assert(ret == 0);

M
Minghao Li 已提交
25 26 27 28 29 30 31 32 33
  for (int i = 0; i < 3; ++i) {
    ret = syncIOPingTimerStart();
    assert(ret == 0);
    taosMsleep(5000);

    ret = syncIOPingTimerStop();
    assert(ret == 0);
    taosMsleep(5000);
  }
M
sync io  
Minghao Li 已提交
34 35

  while (1) {
wafwerar's avatar
wafwerar 已提交
36
    taosSsleep(1);
M
sync io  
Minghao Li 已提交
37 38 39
  }
  return 0;
}