mirror of
https://github.com/ThrowTheSwitch/CMock.git
synced 2026-10-01 22:47:25 +00:00
- fixed bug in cmock header generation if using non-default mock prefix.
git-svn-id: http://cmock.svn.sourceforge.net/svnroot/cmock/trunk@69 bf332499-1b4d-0410-844d-d2d48d5cc64c
This commit is contained in:
@@ -49,7 +49,7 @@ class CMockGenerator
|
|||||||
|
|
||||||
def create_mock_header_header(file, filename)
|
def create_mock_header_header(file, filename)
|
||||||
define_name = filename.gsub(/\.h/, "_h").upcase
|
define_name = filename.gsub(/\.h/, "_h").upcase
|
||||||
orig_filename = filename.gsub("Mock", "")
|
orig_filename = filename.gsub(@config.mock_prefix, "")
|
||||||
file << "/* AUTOGENERATED FILE. DO NOT EDIT. */\n"
|
file << "/* AUTOGENERATED FILE. DO NOT EDIT. */\n"
|
||||||
file << "#ifndef _#{define_name}\n"
|
file << "#ifndef _#{define_name}\n"
|
||||||
file << "#define _#{define_name}\n\n"
|
file << "#define _#{define_name}\n\n"
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ class CMockGeneratorTest < Test::Unit::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
should "create the top of a header file" do
|
should "create the top of a header file" do
|
||||||
|
@config.expect.mock_prefix.returns("Mock")
|
||||||
orig_filename = "PoutPoutFish.h"
|
orig_filename = "PoutPoutFish.h"
|
||||||
define_name = "MOCKPOUTPOUTFISH_H"
|
define_name = "MOCKPOUTPOUTFISH_H"
|
||||||
mock_name = "MockPoutPoutFish"
|
mock_name = "MockPoutPoutFish"
|
||||||
|
|||||||
Reference in New Issue
Block a user