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
This commit is contained in:
Enji Cooper 2017-04-21 07:38:30 +00:00
parent f11b8ffef8
commit 1f03aa3992
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=439018
2 changed files with 20 additions and 1 deletions

View file

@ -3,7 +3,7 @@
PORTNAME= kyua
PORTVERSION= 0.13
PORTEPOCH= 3
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= devel
MASTER_SITES= https://github.com/jmmv/kyua/releases/download/${PORTNAME}-${PORTVERSION}/ \
LOCAL/jmmv

View file

@ -0,0 +1,19 @@
--- 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);
}