summaryrefslogtreecommitdiffstats
path: root/staging_vespalib
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2019-12-16 23:18:41 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2019-12-16 23:18:41 +0000
commit08fb72c58d39698d15ee7e3a0b967accbaa8bd5b (patch)
treebc94ab1ced714a3e681a79b6f6ad444ec32b158e /staging_vespalib
parent3415614a539e1e923513ac941c3b9ea7d171ae95 (diff)
Convert to double before computations.
Diffstat (limited to 'staging_vespalib')
-rw-r--r--staging_vespalib/src/tests/clock/clock_benchmark.cpp2
-rw-r--r--staging_vespalib/src/tests/rusage/rusage_test.cpp24
2 files changed, 5 insertions, 21 deletions
diff --git a/staging_vespalib/src/tests/clock/clock_benchmark.cpp b/staging_vespalib/src/tests/clock/clock_benchmark.cpp
index 1a4cb20e338..cbf7275f06e 100644
--- a/staging_vespalib/src/tests/clock/clock_benchmark.cpp
+++ b/staging_vespalib/src/tests/clock/clock_benchmark.cpp
@@ -123,7 +123,7 @@ void benchmark(const char * desc, FastOS_ThreadPool & pool, uint64_t samples, ui
count[i] += sampler->_count[i];
}
}
- printf("%s: Took %ld clock samples in %2.3f with [%ld, %ld, %ld] counts\n", desc, samples, to_s(steady_clock ::now() - start), count[0], count[1], count[2]);
+ printf("%s: Took %ld clock samples in %2.3f with [%ld, %ld, %ld] counts\n", desc, samples, to_s(steady_clock::now() - start), count[0], count[1], count[2]);
}
int
diff --git a/staging_vespalib/src/tests/rusage/rusage_test.cpp b/staging_vespalib/src/tests/rusage/rusage_test.cpp
index 942140086d6..0f2992e09e8 100644
--- a/staging_vespalib/src/tests/rusage/rusage_test.cpp
+++ b/staging_vespalib/src/tests/rusage/rusage_test.cpp
@@ -5,23 +5,7 @@
using namespace vespalib;
-class Test : public TestApp
-{
-public:
- int Main() override;
- void testRUsage();
-};
-
-int
-Test::Main()
-{
- TEST_INIT("rusage_test");
- testRUsage();
- TEST_DONE();
-}
-
-void
-Test::testRUsage()
+TEST("testRUsage")
{
RUsage r1;
EXPECT_EQUAL("", r1.toString());
@@ -30,12 +14,12 @@ Test::testRUsage()
RUsage diff = r2-r1;
EXPECT_EQUAL(diff.toString(), r2.toString());
{
- RUsage then = RUsage::createSelf(steady_time(duration(7)));
+ RUsage then = RUsage::createSelf(steady_time(7ns));
RUsage now = RUsage::createSelf();
EXPECT_NOT_EQUAL(now.toString(), then.toString());
}
{
- RUsage then = RUsage::createChildren(steady_time(duration(1337583)));
+ RUsage then = RUsage::createChildren(steady_time(1337583ns));
RUsage now = RUsage::createChildren();
EXPECT_NOT_EQUAL(now.toString(), then.toString());
}
@@ -70,4 +54,4 @@ Test::testRUsage()
}
}
-TEST_APPHOOK(Test)
+TEST_MAIN() { TEST_RUN_ALL(); }