Skip to content

Commit d659e37

Browse files
committed
Fixed minor issue with space padding on results and improved timing testing to always make at least one call to a function being timed.
1 parent 47c3030 commit d659e37

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

test/TestClass.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -855,7 +855,7 @@ class TestClass
855855
char const* str_no_tests = "* NO TESTS *";
856856

857857
TestString::size_type const max_chars =
858-
Max(max_digits + TestStringUtility::UnsafeLength(str_test) + 1,
858+
Max(max_digits + TestStringUtility::UnsafeLength(str_tests) + 1,
859859
TestStringUtility::UnsafeLength(str_test));
860860

861861
// Build up the string with number of tests or failed tests, then appended message.

test/TestMacros.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,11 +384,11 @@ TEST_OVERRIDE_LOG(MyFunctor, new MyFunctor());
384384
}
385385

386386
#ifndef CHECK_TIME
387-
#define CHECK_TIME(func) while (true) { func; if (CheckTime()) break; }
387+
#define CHECK_TIME(func) do { func; } while (!CheckTime())
388388
#endif
389389

390390
#ifndef CHECK_PERFORMANCE
391-
#define CHECK_PERFORMANCE(func, min_iterations) for (ocl::TestString filename(__FILE__); !CheckTime((ocl::ocl_size_type)min_iterations, filename, (ocl::ocl_size_type)__LINE__); ) func
391+
#define CHECK_PERFORMANCE(func, min_iterations) for (ocl::TestString filename(__FILE__);;) { func; if (CheckTime((ocl::ocl_size_type)min_iterations, filename, (ocl::ocl_size_type)__LINE__)) break; }
392392
#endif
393393

394394
#endif // OCL_GUARD_TEST_TESTMACROS_HPP

0 commit comments

Comments
 (0)