proxygen
Util.h File Reference

Go to the source code of this file.

Macros

#define T_CHECK_TIMEOUT(start, end, expectedMS, ...)
 
#define T_CHECK_TIME_LT(start, end, expectedMS, ...)
 

Macro Definition Documentation

#define T_CHECK_TIME_LT (   start,
  end,
  expectedMS,
  ... 
)
Value:
(start), (end), (expectedMS), true, ##__VA_ARGS__)) { \
SKIP() << "T_CHECK_TIMEOUT_LT lapsed"; \
}
bool checkTimeout(const TimePoint &start, const TimePoint &end, nanoseconds expected, bool allowSmaller, nanoseconds tolerance)
Definition: TimeUtil.cpp:241
#define SKIP()
Definition: TestUtils.h:55
auto end(TestAdlIterable &instance)
Definition: ForeachTest.cpp:62
auto start

Verify that an event took less than a specified amount of time.

This is similar to T_CHECK_TIMEOUT, but does not fail if the event took less than the allowed time.

Definition at line 50 of file Util.h.

Referenced by TEST().

#define T_CHECK_TIMEOUT (   start,
  end,
  expectedMS,
  ... 
)
Value:
(start), (end), (expectedMS), false, ##__VA_ARGS__)) { \
SKIP() << "T_CHECK_TIMEOUT lapsed"; \
}
bool checkTimeout(const TimePoint &start, const TimePoint &end, nanoseconds expected, bool allowSmaller, nanoseconds tolerance)
Definition: TimeUtil.cpp:241
#define SKIP()
Definition: TestUtils.h:55
auto end(TestAdlIterable &instance)
Definition: ForeachTest.cpp:62
auto start

Check how long a timeout took to fire.

This method verifies:

  • that the timeout did not fire too early (never less than expectedMS)
  • that the timeout fired within a reasonable period of the expected duration. It must fire within the specified tolerance, excluding time that this process spent waiting to be scheduled.
Parameters
startA TimePoint object set just before the timeout was scheduled.
endA TimePoint object set when the timeout fired.
expectedMSThe timeout duration, in milliseconds
toleranceThe tolerance, in milliseconds.

Definition at line 38 of file Util.h.

Referenced by TEST(), and TEST_F().