Handle headers which only have inline-function-declarations

This means there is NO opening bracket, since there are no struct
declarations or inline function definitions.
This commit is contained in:
laurens
2020-01-14 22:18:17 +01:00
committed by laurensmiers
parent 7a5d712d79
commit 3254aef5e5
2 changed files with 14 additions and 1 deletions
+13
View File
@@ -2119,6 +2119,19 @@ describe CMockHeaderParser, "Verify CMockHeaderParser Module" do
assert_equal(expected, @parser.transform_inline_functions(source))
end
it "Transform inline functions can handle header with only inline function declarations" do
source =
"static inline int dummy_func_decl(int a, char b, float c);\n" +
"\n"
expected =
"int dummy_func_decl(int a, char b, float c);\n" +
"\n"
@parser.treat_inlines = :include
assert_equal(expected, @parser.transform_inline_functions(source))
end
it "Transform inline functions takes user provided patterns into account" do
source =
"static __inline__ __attribute__ ((always_inline)) uint16_t _somefunc (uint32_t a)\n" +