Rename normalize_source to transform_inline_functions

This commit is contained in:
laurens
2019-11-10 20:13:35 +01:00
parent e0a61d484e
commit e1c6851492
2 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -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)
+4 -4
View File
@@ -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