syncUtilTest.cpp 708 字节
Newer Older
M
Minghao Li 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#include "syncUtil.h"
//#include <gtest/gtest.h>
#include <stdio.h>
#include "syncIO.h"
#include "syncInt.h"
#include "syncRaftStore.h"

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");
}

void electRandomMSTest() {
  for (int i = 0; i < 10; ++i) {
M
Minghao Li 已提交
19
    int32_t ms = syncUtilElectRandomMS(150, 300);
M
Minghao Li 已提交
20 21 22 23 24 25 26 27 28
    printf("syncUtilElectRandomMS: %d \n", ms);
  }
}

int main() {
  // taosInitLog((char *)"syncTest.log", 100000, 10);
  tsAsyncLog = 0;
  sDebugFlag = 143 + 64;
  logTest();
M
Minghao Li 已提交
29

M
Minghao Li 已提交
30 31 32 33
  electRandomMSTest();

  return 0;
}