Skip to content

Commit

Permalink
Merge pull request #451 from informatimago/treat_as-better-error-message
Browse files Browse the repository at this point in the history
Added a user-friendly error message when processing bad :treat_as
  • Loading branch information
mvandervoord authored Jul 29, 2023
2 parents ed29ce3 + c05e08d commit a3a48e8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/cmock_unityhelper_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ def get_helper(ctype)
def map_c_types
c_types = {}
@config.treat_as.each_pair do |ctype, expecttype|
if ctype.is_a?(Symbol)
raise ":treat_as expects a list of identifier: identifier mappings, but got a symbol: #{ctype}. Check the indentation in your project.yml"
end
c_type = ctype.gsub(/\s+/, '_')
if expecttype =~ /\*/
c_types[c_type] = "UNITY_TEST_ASSERT_EQUAL_#{expecttype.delete('*')}_ARRAY"
Expand Down

0 comments on commit a3a48e8

Please sign in to comment.