mirror of
https://github.com/ThrowTheSwitch/CMock.git
synced 2026-06-05 21:15:20 +00:00
Rename normalize_source to transform_inline_functions
This commit is contained in:
@@ -46,13 +46,13 @@ class CMockHeaderParser
|
||||
{ :includes => nil,
|
||||
:functions => @funcs,
|
||||
:typedefs => @typedefs,
|
||||
:normalized_source => normalize_source(source),
|
||||
:normalized_source => transform_inline_functions(source),
|
||||
}
|
||||
end
|
||||
|
||||
private if $ThisIsOnlyATest.nil? ################
|
||||
|
||||
def normalize_source(source)
|
||||
def transform_inline_functions(source)
|
||||
# let's clean up the encoding in case they've done anything weird with the characters we might find
|
||||
source = source.force_encoding("ISO-8859-1").encode("utf-8", :replace => nil)
|
||||
|
||||
|
||||
@@ -1780,7 +1780,7 @@ describe CMockHeaderParser, "Verify CMockHeaderParser Module" do
|
||||
end
|
||||
end
|
||||
|
||||
it "Normalize source doesn't change a header with no inlines" do
|
||||
it "Transform inline functions doesn't change a header with no inlines" do
|
||||
source =
|
||||
"#ifndef _NOINCLUDES\n" +
|
||||
"#define _NOINCLUDES\n" +
|
||||
@@ -1811,10 +1811,10 @@ describe CMockHeaderParser, "Verify CMockHeaderParser Module" do
|
||||
"\n"
|
||||
"#endif _NOINCLUDES\n"
|
||||
|
||||
assert_equal(source, @parser.normalize_source(source))
|
||||
assert_equal(source, @parser.transform_inline_functions(source))
|
||||
end
|
||||
|
||||
it "Normalize source changes inline functions to function declarations" do
|
||||
it "Transform inline functions changes inline functions to function declarations" do
|
||||
source =
|
||||
"#ifndef _NOINCLUDES\n" +
|
||||
"#define _NOINCLUDES\n" +
|
||||
@@ -1879,7 +1879,7 @@ describe CMockHeaderParser, "Verify CMockHeaderParser Module" do
|
||||
"\n"
|
||||
"#endif _NOINCLUDES\n"
|
||||
|
||||
assert_equal(expected, @parser.normalize_source(source))
|
||||
assert_equal(expected, @parser.transform_inline_functions(source))
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user