tools: add congestion marking parameters to nfdc face create
refs #4465
Change-Id: I5df5d6136f4729ad836a72f55531208d868da5f7
diff --git a/tests/tools/nfdc/format-helpers.t.cpp b/tests/tools/nfdc/format-helpers.t.cpp
index 6184401..a94d2ba 100644
--- a/tests/tools/nfdc/format-helpers.t.cpp
+++ b/tests/tools/nfdc/format-helpers.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017, Regents of the University of California,
+/*
+ * Copyright (c) 2014-2018, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -48,6 +48,30 @@
" surround XML <element> tag name"));
}
+BOOST_AUTO_TEST_CASE(DurationFormatting)
+{
+ time::nanoseconds d1 = 53000_s + 87_ms + 3_us;
+ BOOST_CHECK_EQUAL(xml::formatDuration(d1), "PT53000.087S");
+
+ time::nanoseconds d2 = 56_s;
+ BOOST_CHECK_EQUAL(xml::formatDuration(d2), "PT56S");
+
+ time::nanoseconds d3 = 3_min;
+ BOOST_CHECK_EQUAL(xml::formatDuration(d3), "PT180S");
+
+ time::nanoseconds d4 = 0_ns;
+ BOOST_CHECK_EQUAL(xml::formatDuration(d4), "PT0S");
+
+ time::nanoseconds d5 = 1_ms;
+ BOOST_CHECK_EQUAL(xml::formatDuration(d5), "PT0.001S");
+
+ time::nanoseconds d6 = -53_s - 250_ms;
+ BOOST_CHECK_EQUAL(xml::formatDuration(d6), "-PT53.250S");
+
+ time::nanoseconds d7 = 1_us;
+ BOOST_CHECK_EQUAL(xml::formatDuration(d7), "PT0S");
+}
+
BOOST_AUTO_TEST_SUITE_END() // Xml
BOOST_AUTO_TEST_SUITE(Text)