Skip to content

Commit 7d6b849

Browse files
committed
Fixed white space problem with output.
1 parent d659e37 commit 7d6b849

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

test/TestClass.hpp

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -849,15 +849,11 @@ class TestClass
849849
// Log the part that follows the function name.
850850
void privateLogNumberOfRunTests()
851851
{
852-
char const* str_test = " TEST ";
853-
char const* str_tests = " TESTS ";
854-
char const* str_failed = " FAILED";
852+
char const* str_test = " TEST ";
853+
char const* str_tests = " TESTS ";
854+
char const* str_failed = " FAILED ";
855855
char const* str_no_tests = "* NO TESTS *";
856856

857-
TestString::size_type const max_chars =
858-
Max(max_digits + TestStringUtility::UnsafeLength(str_tests) + 1,
859-
TestStringUtility::UnsafeLength(str_test));
860-
861857
// Build up the string with number of tests or failed tests, then appended message.
862858
TestString whole_str;
863859
TestString msg_str;
@@ -881,7 +877,14 @@ class TestClass
881877
msg_str.Append(str_no_tests);
882878

883879
whole_str.Append(msg_str);
884-
whole_str.PadRight(' ', max_chars);
880+
881+
static const ocl_size_type str_no_tests_len = TestStringUtility::UnsafeLength(str_no_tests);
882+
static const ocl_size_type str_failed_len = TestStringUtility::UnsafeLength(str_failed);
883+
884+
// Calculate difference between no tests and number + tests to ensure the padding lines
885+
// up the functions in the right column.
886+
ocl_size_type padding = (max_digits + str_failed_len + 1) - str_no_tests_len;
887+
whole_str.PadRight(' ', str_no_tests_len + padding);
885888

886889
LogWrite(whole_str);
887890
}

0 commit comments

Comments
 (0)