freebsd-ports/devel/kyua/files/patch-utils_datetime__test.cpp
Enji Cooper 1f03aa3992 Fix utils/datetime_test:timestamp__subtraction
Don't expect a negative time delta to throw an exception--instead, expect
1 microsecond to be returned per the behavior change made in r436312.

Approved by:	brooks (as part of a larger diff), (maintainer timeout)
Differential Revision:	D10316
PR:		217973
Reported by:	Jenkins
Reviewed by:	asomers
Sponsored by:	Dell EMC Isilon
2017-04-21 07:38:30 +00:00

19 lines
656 B
C++

--- utils/datetime_test.cpp.orig 2017-04-08 05:25:26 UTC
+++ utils/datetime_test.cpp
@@ -532,11 +532,11 @@ ATF_TEST_CASE_BODY(timestamp__subtractio
ATF_REQUIRE_EQ(datetime::delta(100, 0), ts3 - ts1);
ATF_REQUIRE_EQ(datetime::delta(99, 999988), ts3 - ts2);
- ATF_REQUIRE_THROW_RE(
- std::runtime_error,
- "Cannot subtract 1291970850123456us from 1291970750123468us "
- ".*negative datetime::delta.*not supported",
- ts2 - ts3);
+ /*
+ * NOTE (ngie): behavior change for
+ * https://github.com/jmmv/kyua/issues/155 .
+ */
+ ATF_REQUIRE_EQ(datetime::delta::from_microseconds(1), ts2 - ts3);
}