Fix compiler error when compiling with -Wcast-qual and mocking const function arguments

This commit is contained in:
bal-stan
2025-04-01 16:24:48 +00:00
parent 204117cb59
commit 076df6dd5c
2 changed files with 11 additions and 11 deletions
+2 -2
View File
@@ -267,7 +267,7 @@ describe CMockGeneratorUtils, "Verify CMockGeneratorUtils Module" do
arg = test_arg[:mytype]
expected = " {\n" +
" UNITY_SET_DETAILS(CMockString_Pear,CMockString_MyMyType);\n" +
" UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(&cmock_call_instance->Expected_MyMyType), (void*)(&MyMyType), sizeof(MY_TYPE), cmock_line, CMockStringMismatch);\n" +
" UNITY_TEST_ASSERT_EQUAL_MEMORY(&cmock_call_instance->Expected_MyMyType, &MyMyType, sizeof(MY_TYPE), cmock_line, CMockStringMismatch);\n" +
" }\n"
@unity_helper.expect :nil?, false
@unity_helper.expect :get_helper, ['UNITY_TEST_ASSERT_EQUAL_MEMORY','&'], ['MY_TYPE']
@@ -351,7 +351,7 @@ describe CMockGeneratorUtils, "Verify CMockGeneratorUtils Module" do
" if (cmock_call_instance->Expected_MyMyType == NULL)\n" +
" { UNITY_TEST_ASSERT_NULL(MyMyType, cmock_line, CMockStringExpNULL); }\n" +
" else\n" +
" { UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((void*)(cmock_call_instance->Expected_MyMyType), (void*)(MyMyType), sizeof(MY_TYPE), 1, cmock_line, CMockStringMismatch); }\n" +
" { UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY(cmock_call_instance->Expected_MyMyType, MyMyType, sizeof(MY_TYPE), 1, cmock_line, CMockStringMismatch); }\n" +
" }\n"
@unity_helper.expect :nil?, false
@unity_helper.expect :get_helper, ['UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY', ''], ['MY_TYPE']