Skip to content

Commit

Permalink
cleanup the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
acgreek committed Dec 26, 2015
1 parent 9ec1811 commit 11dabdf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
.dep/
obj*/
dist*/
CMakeCache.txt
CMakeFiles
ExtremeCMock.pc
Expand Down
6 changes: 3 additions & 3 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ to build and run the test app, you need to install my ExtremeCUnit testing frame
EXAMPLE
Say you have some library that function you want to test and it calls the libc function 'time_t time(time_t * t)'. That is going to return current time which is not necessarily going to be consistent in your test. So here is an example of how to mock the time function. It works even when some library you are linking with calls the time function

source for mock_time.c :
source for time_mock.c :
..
#include <time.h>
#include <stdio.h>
Expand All @@ -41,8 +41,8 @@ int main (int argc, char *argv) {
..

compile and run :
username@hostname:~/my-src/ExtremeCMock$ gcc -o mock_time mock_time.c `pkg-config --cflags --libs ExtremeCMock`
username@hostname:~/my-src/ExtremeCMock$ ./mock_time
username@hostname:~/my-src/ExtremeCMock$ gcc -o time_mock time_mock.c `pkg-config --cflags --libs ExtremeCMock`
username@hostname:~/my-src/ExtremeCMock$ ./time_mock
time is now 1343102848
time is now 10
time is now 11
Expand Down

0 comments on commit 11dabdf

Please sign in to comment.