Fixed code.google.com/p/cmockery Issue 5: Using will_return_count with count=-1 ...
authorstewartamiles <stewartamiles@40f4469a-5155-0410-be90-2de3f0bae501>
Thu, 23 Jul 2009 16:32:06 +0000 (16:32 +0000)
committerstewartamiles <stewartamiles@40f4469a-5155-0410-be90-2de3f0bae501>
Thu, 23 Jul 2009 16:32:06 +0000 (16:32 +0000)
git-svn-id: http://cmockery.googlecode.com/svn/trunk@30 40f4469a-5155-0410-be90-2de3f0bae501

src/cmockery.c

index fe9b88de1f9f7076fdaf9c9e308c53850d29b3c1..9d01cd2fe9801dd69ff18383ddedbae08cf50c34 100755 (executable)
@@ -651,7 +651,7 @@ void* _mock(const char * const function, const char* const file,
 void _will_return(const char * const function_name, const char * const file, 
                   const int line, const void* const value, const int count) {
        SymbolValue * const return_value = malloc(sizeof(*return_value));
 void _will_return(const char * const function_name, const char * const file, 
                   const int line, const void* const value, const int count) {
        SymbolValue * const return_value = malloc(sizeof(*return_value));
-       assert_true(count > 0);
+       assert_true(count > 0 || count == -1);
        return_value->value = value;
        set_source_location(&return_value->location, file, line);
        add_symbol_value(&global_function_result_map_head, &function_name, 1,
        return_value->value = value;
        set_source_location(&return_value->location, file, line);
        add_symbol_value(&global_function_result_map_head, &function_name, 1,