hominlinx / cmockery

Automatically exported from code.google.com/p/cmockery
0 stars 0 forks source link

index.html fail_connect_to_customer_database() code doesn't match example source #28

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Open http://cmockery.googlecode.com/svn/trunk/doc/index.html#Mock_Functions 
2. Observe the fail_connect_to_customer_database() source and note that it 
won't fail as the comment explains, because it includes a will_return() call
3. Compare that to 
http://code.google.com/p/cmockery/source/browse/trunk/src/example/customer_datab
ase_test.c?r=42, which doesn't include the will_return() call

What version of the product are you using? 
0.1.2

Index: index.html
===================================================================
--- index.html  (revision 42)
+++ index.html  (working copy)
@@ -466,7 +466,6 @@
 /* This test fails as the mock function connect_to_database() will have no
  * value to return. */
 void fail_connect_to_customer_database(void **state) {
-    will_return(connect_to_database, 0x0DA7ABA53);
     assert_true(connect_to_customer_database() ==
                 (DatabaseConnection*)0x0DA7ABA53);
 }

Original issue reported on code.google.com by daryl.sp...@gmail.com on 4 Jan 2011 at 7:14