@@ -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