syncUtilTest.cpp 571 字节
Newer Older
1
#include "syncTest.h"
M
Minghao Li 已提交
2 3 4 5 6 7 8 9 10 11 12 13

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 已提交
14
    int32_t ms = syncUtilElectRandomMS(150, 300);
M
Minghao Li 已提交
15 16 17 18 19 20
    printf("syncUtilElectRandomMS: %d \n", ms);
  }
}

int main() {
  tsAsyncLog = 0;
M
Minghao Li 已提交
21
  sDebugFlag = DEBUG_TRACE + DEBUG_SCREEN + DEBUG_FILE;
M
Minghao Li 已提交
22
  logTest();
M
Minghao Li 已提交
23

M
Minghao Li 已提交
24 25 26 27
  electRandomMSTest();

  return 0;
}