From d65594ea7335dd11031eb13d6b0a9a3d5955e419 Mon Sep 17 00:00:00 2001 From: stewartamiles Date: Thu, 23 Jul 2009 16:32:06 +0000 Subject: [PATCH] Fixed code.google.com/p/cmockery Issue 5: Using will_return_count with count=-1 (to always repeat return value) results in assertion failure. git-svn-id: http://cmockery.googlecode.com/svn/trunk@30 40f4469a-5155-0410-be90-2de3f0bae501 --- src/cmockery.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmockery.c b/src/cmockery.c index fe9b88d..9d01cd2 100755 --- a/src/cmockery.c +++ b/src/cmockery.c @@ -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)); - 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, -- 2.34.1