From ac0ae65802fddf79ce94bf9229bae094de0d688e Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 25 Jun 2015 23:13:41 +0300 Subject: Add missing checks into test directory. --- src/test/testlauncher.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/test/testlauncher.cpp') diff --git a/src/test/testlauncher.cpp b/src/test/testlauncher.cpp index a2738c8ba..84890fe85 100644 --- a/src/test/testlauncher.cpp +++ b/src/test/testlauncher.cpp @@ -188,7 +188,7 @@ int TestLauncher::testFps() } gettimeofday(&end, nullptr); - const int tFps = calcFps(&start, &end, cnt); + const int tFps = calcFps(start, end, cnt); file << mTest << std::endl; file << tFps << std::endl; @@ -220,7 +220,7 @@ int TestLauncher::testFps2() } gettimeofday(&end, nullptr); - const int tFps = calcFps(&start, &end, cnt); + const int tFps = calcFps(start, end, cnt); file << mTest << std::endl; file << tFps << std::endl; @@ -267,7 +267,7 @@ int TestLauncher::testFps3() } gettimeofday(&end, nullptr); - const int tFps = calcFps(&start, &end, cnt); + const int tFps = calcFps(start, end, cnt); file << mTest << std::endl; file << tFps << std::endl; @@ -406,7 +406,7 @@ int TestLauncher::testInternal() } gettimeofday(&end, nullptr); - const int tFps = calcFps(&start, &end, cnt); + const int tFps = calcFps(start, end, cnt); file << mTest << std::endl; file << tFps << std::endl; file << mem << std::endl; @@ -657,15 +657,16 @@ int TestLauncher::testVideoDetection() return 0; } -int TestLauncher::calcFps(const timeval *const start, const timeval *const end, +int TestLauncher::calcFps(const timeval &start, + const timeval &end, const int calls) const { long mtime; long seconds; long useconds; - seconds = end->tv_sec - start->tv_sec; - useconds = end->tv_usec - start->tv_usec; + seconds = end.tv_sec - start.tv_sec; + useconds = end.tv_usec - start.tv_usec; mtime = (seconds * 1000 + useconds / 1000.0) + 0.5; if (mtime == 0) -- cgit v1.2.3-60-g2f50