- Added a couple more tests to our details test

- Added a gitattributes file to force line endings to be correct.
This commit is contained in:
Mark VanderVoord
2015-12-30 16:33:33 -05:00
parent cda8d3a7e1
commit d1ab630308
4 changed files with 720 additions and 654 deletions
+30
View File
@@ -0,0 +1,30 @@
* text=auto
# These files are text and should be normalized (convert crlf to lf)
*.rb text
*.test text
*.c text
*.cpp text
*.h text
*.txt text
*.yml text
*.s79 text
*.bat text
*.xcl text
*.inc text
*.info text
*.md text
makefile text
rakefile text
#These files are binary and should not be normalized
*.doc binary
*.odt binary
*.pdf binary
*.ewd binary
*.eww binary
*.dni binary
*.wsdt binary
*.dbgdt binary
*.mac binary
@@ -4,7 +4,7 @@ class CMockGeneratorPluginReturnThruPtr
def initialize(config, utils)
@utils = utils
@priority = 1
@priority = 1 #TODO: it's 1 to come before ignore_arg returns... but should be after expects otherwise (like 9)
end
def instance_typedefs(function)
+1 -1
View File
@@ -264,7 +264,7 @@ module RakefileHelpers
# some tests have additional requirements to check for (checking the actual output message)
if (test[:verify_error]) and not (test_results[index] =~ /test#{index+1}:.*#{test[:verify_error]}/)
total_failures += 1
failure_messages << "#{test_file}:test#{index+1}:should #{test[:should]}:should have output matching '#{test[:verify_error]}'"
failure_messages << "#{test_file}:test#{index+1}:should #{test[:should]}:should have output matching '#{test[:verify_error]}' but was '#{test_results[index]}'"
end
end
end
@@ -30,10 +30,7 @@
:header: |
#include "CException.h"
void function_a(void);
void function_b(void);
void function_c(void);
int function_d(void);
void function_e(void);
int function_b(void);
:code: |
void function_a(void)
@@ -42,6 +39,13 @@
no_args();
}
int function_b(void)
{
POINT_T pt = { 1, 2 };
foo(&pt);
return (pt.x + pt.y);
}
:tests:
:common: |
#include "CException.h"
@@ -269,4 +273,36 @@
TEST_ASSERT_EQUAL_INT_MESSAGE(1,2,"CustomFail");
}
- :pass: FALSE
:should: 'not contain mock details in failed assertion after mock which threw a CException'
:verify_error: 'FAIL: Expected 1 Was 2. CustomFail'
:code: |
test()
{
CEXCEPTION_T e;
bar_ExpectAndThrow(0x12);
Try {
function_a();
}
Catch(e) {}
TEST_ASSERT_EQUAL_INT_MESSAGE(1,2,"CustomFail");
}
- :pass: FALSE
:should: 'not contain mock details in failed assertion after mock which used a return thru ptr'
#:verify_error: 'FAIL: Expected 3 Was 7. CustomFail' #TODO: put back in once ReturnThruPtr fixed
:code: |
test()
{
POINT_T pt1 = { 1, 2 };
POINT_T pt2 = { 3, 4 };
foo_Expect(&pt1);
foo_ReturnThruPtr_a(&pt2);
TEST_ASSERT_EQUAL_INT(3, function_b());
}
...