mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2026-09-07 18:59:58 +00:00
Fix stylistic issues.
Replace bool with portable int (it's C, after all).
This commit is contained in:
@@ -407,43 +407,43 @@ class UnityTestRunnerGenerator
|
||||
end
|
||||
|
||||
def create_run_test(output)
|
||||
output.puts("/*=======Test Runner Used To Run Each Test=====*/")
|
||||
output.puts("static void run_test(UnityTestFunction func, const char* name, UNITY_LINE_TYPE line_num)")
|
||||
output.puts("{")
|
||||
output.puts(" Unity.CurrentTestName = name;")
|
||||
output.puts(" Unity.CurrentTestLineNumber = (UNITY_UINT) line_num;")
|
||||
output.puts("#ifdef UNITY_USE_COMMAND_LINE_ARGS")
|
||||
output.puts(" if (!UnityTestMatches())")
|
||||
output.puts(" return;")
|
||||
output.puts("#endif")
|
||||
output.puts(" Unity.NumberOfTests++;")
|
||||
output.puts(" UNITY_CLR_DETAILS();")
|
||||
output.puts(" UNITY_EXEC_TIME_START();")
|
||||
output.puts(" CMock_Init();")
|
||||
output.puts(" if (TEST_PROTECT())")
|
||||
output.puts(" {")
|
||||
output.puts('/*=======Test Runner Used To Run Each Test=====*/')
|
||||
output.puts('static void run_test(UnityTestFunction func, const char* name, UNITY_LINE_TYPE line_num)')
|
||||
output.puts('{')
|
||||
output.puts(' Unity.CurrentTestName = name;')
|
||||
output.puts(' Unity.CurrentTestLineNumber = (UNITY_UINT) line_num;')
|
||||
output.puts('#ifdef UNITY_USE_COMMAND_LINE_ARGS')
|
||||
output.puts(' if (!UnityTestMatches())')
|
||||
output.puts(' return;')
|
||||
output.puts('#endif')
|
||||
output.puts(' Unity.NumberOfTests++;')
|
||||
output.puts(' UNITY_CLR_DETAILS();')
|
||||
output.puts(' UNITY_EXEC_TIME_START();')
|
||||
output.puts(' CMock_Init();')
|
||||
output.puts(' if (TEST_PROTECT())')
|
||||
output.puts(' {')
|
||||
if @options[:plugins].include?(:cexception)
|
||||
output.puts(" volatile CEXCEPTION_T e;")
|
||||
output.puts(" Try {")
|
||||
output.puts(' volatile CEXCEPTION_T e;')
|
||||
output.puts(' Try {')
|
||||
output.puts(" #{@options[:setup_name]}();")
|
||||
output.puts(" func();")
|
||||
output.puts(" } Catch(e) {")
|
||||
output.puts(" TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, \"Unhandled Exception!\");")
|
||||
output.puts(" }")
|
||||
output.puts(' func();')
|
||||
output.puts(' } Catch(e) {')
|
||||
output.puts(' TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!");')
|
||||
output.puts(' }')
|
||||
else
|
||||
output.puts(" #{@options[:setup_name]}();")
|
||||
output.puts(" func();")
|
||||
output.puts(' func();')
|
||||
end
|
||||
output.puts(" }")
|
||||
output.puts(" if (TEST_PROTECT())")
|
||||
output.puts(" {")
|
||||
output.puts(' }')
|
||||
output.puts(' if (TEST_PROTECT())')
|
||||
output.puts(' {')
|
||||
output.puts(" #{@options[:teardown_name]}();")
|
||||
output.puts(" CMock_Verify();")
|
||||
output.puts(" }")
|
||||
output.puts(" CMock_Destroy();")
|
||||
output.puts(" UNITY_EXEC_TIME_STOP();")
|
||||
output.puts(" UnityConcludeTest();")
|
||||
output.puts("}")
|
||||
output.puts(' CMock_Verify();')
|
||||
output.puts(' }')
|
||||
output.puts(' CMock_Destroy();')
|
||||
output.puts(' UNITY_EXEC_TIME_STOP();')
|
||||
output.puts(' UnityConcludeTest();')
|
||||
output.puts('}')
|
||||
end
|
||||
|
||||
def create_args_wrappers(output, tests)
|
||||
@@ -465,7 +465,7 @@ class UnityTestRunnerGenerator
|
||||
def create_warning_test(output, filename, tests)
|
||||
if count_tests(tests) == 0
|
||||
warning_test = {
|
||||
:test => "test_empty_warning",
|
||||
:test => 'test_empty_warning',
|
||||
:line_number => 0
|
||||
}
|
||||
output.puts("\n/*=======Warning Test=====*/")
|
||||
@@ -475,7 +475,7 @@ class UnityTestRunnerGenerator
|
||||
output.puts("}\n")
|
||||
tests = [warning_test]
|
||||
end
|
||||
return tests
|
||||
tests
|
||||
end
|
||||
|
||||
def create_shuffle_tests(output)
|
||||
|
||||
+3
-3
@@ -91,10 +91,10 @@ static const char UNITY_PROGMEM UnityStrDetail2Name[] = " " UNITY_DET
|
||||
static void UnityPrintChar(const char* pch)
|
||||
{
|
||||
#ifdef UNITY_IS_PRINTABLE_CHAR
|
||||
const bool isPrintable = UNITY_IS_PRINTABLE_CHAR(*pch);
|
||||
const int isPrintable = UNITY_IS_PRINTABLE_CHAR(*pch);
|
||||
#else
|
||||
const bool isPrintable = ((32 <= *pch) && (*pch <= 126));
|
||||
#endif // UNITY_IS_PRINTABLE_CHAR
|
||||
const int isPrintable = ((32 <= *pch) && (*pch <= 126));
|
||||
#endif
|
||||
|
||||
/* printable characters plus CR & LF are printed */
|
||||
if (isPrintable)
|
||||
|
||||
+2
-1
@@ -19,6 +19,7 @@ TEMP_DIRS = [
|
||||
|
||||
TEMP_DIRS.each do |dir|
|
||||
directory(dir)
|
||||
CLEAN.include(File.join(dir, '*.*'))
|
||||
CLOBBER.include(dir)
|
||||
end
|
||||
|
||||
@@ -167,7 +168,7 @@ namespace :style do
|
||||
|
||||
desc "Attempt to Autocorrect style"
|
||||
task :auto => ['style:clean'] do
|
||||
execute("rubocop ../auto ../examples ../extras --auto-correct --config .rubocop.yml")
|
||||
execute("rubocop ../auto ../examples ../extras --autocorrect --config .rubocop.yml")
|
||||
report "Autocorrected What We Could."
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user