mirror of
https://github.com/ThrowTheSwitch/CMock.git
synced 2026-09-11 20:59:57 +00:00
Rename treat_inline to treat_inlines
This commit is contained in:
+1
-1
@@ -29,7 +29,7 @@ class CMockConfig
|
||||
:when_ptr => :compare_data, #the options being :compare_ptr, :compare_data, or :smart
|
||||
:verbosity => 2, #the options being 0 errors only, 1 warnings and errors, 2 normal info, 3 verbose
|
||||
:treat_externs => :exclude, #the options being :include or :exclude
|
||||
:treat_inline => :exclude, #the options being :include or :exclude
|
||||
:treat_inlines => :exclude, #the options being :include or :exclude
|
||||
:callback_include_count => true,
|
||||
:callback_after_arg_check => false,
|
||||
:includes => nil,
|
||||
|
||||
@@ -16,7 +16,7 @@ class CMockGenerator
|
||||
@prefix = @config.mock_prefix
|
||||
@suffix = @config.mock_suffix
|
||||
@weak = @config.weak
|
||||
@include_inline = @config.treat_inline
|
||||
@include_inline = @config.treat_inlines
|
||||
@ordered = @config.enforce_strict_ordering
|
||||
@framework = @config.framework.to_s
|
||||
@fail_on_unexpected_calls = @config.fail_on_unexpected_calls
|
||||
@@ -62,7 +62,7 @@ class CMockGenerator
|
||||
end
|
||||
|
||||
def create_mock_header_file(parsed_stuff)
|
||||
if @include_inline
|
||||
if @include_inline == :include
|
||||
@file_writer.create_file(@module_name + ".h", @subdir) do |file, filename|
|
||||
file << parsed_stuff[:normalized_source]
|
||||
end
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
class CMockHeaderParser
|
||||
|
||||
attr_accessor :funcs, :c_attr_noconst, :c_attributes, :treat_as_void, :treat_externs, :treat_inline
|
||||
attr_accessor :funcs, :c_attr_noconst, :c_attributes, :treat_as_void, :treat_externs, :treat_inlines
|
||||
|
||||
def initialize(cfg)
|
||||
@funcs = []
|
||||
@@ -24,9 +24,9 @@ class CMockHeaderParser
|
||||
@local_as_void = @treat_as_void
|
||||
@verbosity = cfg.verbosity
|
||||
@treat_externs = cfg.treat_externs
|
||||
@treat_inline = cfg.treat_inline
|
||||
@treat_inlines = cfg.treat_inlines
|
||||
@c_strippables += ['extern'] if (@treat_externs == :include) #we'll need to remove the attribute if we're allowing externs
|
||||
@c_strippables += ['inline'] if (@treat_inline == :include) #we'll need to remove the attribute if we're allowing externs
|
||||
@c_strippables += ['inline'] if (@treat_inlines == :include) #we'll need to remove the attribute if we're allowing inlines
|
||||
end
|
||||
|
||||
def parse(name, source)
|
||||
@@ -151,7 +151,7 @@ class CMockHeaderParser
|
||||
end
|
||||
end
|
||||
|
||||
if (@treat_inline == :include)
|
||||
if (@treat_inlines == :include)
|
||||
# Functions having "{ }" at this point are/were inline functions,
|
||||
# User wants them in so 'disguise' them as normal functions with the ";"
|
||||
source.gsub!("{ }", ";")
|
||||
@@ -177,7 +177,7 @@ class CMockHeaderParser
|
||||
src_lines.delete_if {|line| !(line =~ /(?:^|\s+)(?:extern)\s+/).nil?} # remove extern functions
|
||||
end
|
||||
|
||||
if (@treat_inline == :include)
|
||||
if (@treat_inlines == :include)
|
||||
src_lines.each {
|
||||
|src_line|
|
||||
src_line.gsub!(/^inline/, "") # Remove "inline" so that they are 'normal' functions
|
||||
|
||||
Reference in New Issue
Block a user