Be More Forgiving in EXPECT_ALMOST()
(This is a merge of http://go/wvgerrit/14776) This change widens the range in EXPECT_ALMOST slightly, to allow for slight timing errors in the tests. Bug: 21489628 Change-Id: Ibb074c2d037566c307c0438efdda3841bc48f7ed
This commit is contained in:
@@ -59,6 +59,7 @@ const int kShortSleep = 1 * kSpeedMultiplier;
|
|||||||
const int kLongSleep = 2 * kSpeedMultiplier;
|
const int kLongSleep = 2 * kSpeedMultiplier;
|
||||||
const uint32_t kDuration = 2 * kSpeedMultiplier;
|
const uint32_t kDuration = 2 * kSpeedMultiplier;
|
||||||
const uint32_t kLongDuration = 5 * kSpeedMultiplier;
|
const uint32_t kLongDuration = 5 * kSpeedMultiplier;
|
||||||
|
const uint32_t kAlmostRange = 3 * kSpeedMultiplier;
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
namespace wvoec {
|
namespace wvoec {
|
||||||
@@ -736,9 +737,9 @@ static void dump_openssl_error() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// We don't expect exact timing.
|
// We don't expect exact timing.
|
||||||
#define EXPECT_ALMOST(A, B) \
|
#define EXPECT_ALMOST(A, B) \
|
||||||
EXPECT_GE(A + kSpeedMultiplier, B); \
|
EXPECT_GE(A + kAlmostRange, B); \
|
||||||
EXPECT_LE(A - kSpeedMultiplier, B);
|
EXPECT_LE(A - kAlmostRange, B);
|
||||||
|
|
||||||
class Session {
|
class Session {
|
||||||
public:
|
public:
|
||||||
|
|||||||
Reference in New Issue
Block a user