aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2020-01-21 11:11:04 +0100
committerAndreas Schneider <asn@cryptomilk.org>2020-01-21 11:11:04 +0100
commitb1f77751c84f900a4c12426b52d8565f5874e649 (patch)
tree80fc7e8264fed18748d17e2a51aa271cf1c9ab40
parentb2a55b14c6c544a3935c745e89e186cdd98f3e15 (diff)
downloadcmocka-b1f77751c84f900a4c12426b52d8565f5874e649.tar.gz
cmocka-b1f77751c84f900a4c12426b52d8565f5874e649.tar.xz
cmocka-b1f77751c84f900a4c12426b52d8565f5874e649.zip
NOTES
-rw-r--r--slides.md45
1 files changed, 44 insertions, 1 deletions
diff --git a/slides.md b/slides.md
index c20db5a..6d11b9c 100644
--- a/slides.md
+++ b/slides.md
@@ -462,7 +462,7 @@ You can also easily extend cmocka by writing special assert functions for your p
Example: socket_wrapper tests has assert functions for sockaddr.
-<!-- .slide: class="tetris-one" -->
+<!-- .slide: class="tetris-one center" -->
---
@@ -503,6 +503,9 @@ note:
<img src="img/unit_test.svg" border="0" />
+note:
+Standard unit test
+
<!-- .slide: class="tetris-two" -->
---
@@ -516,6 +519,11 @@ Lets test 'uptime'
<small>Source code be found in the cmocka source code</small>
+note:
+## An example
+
+Lets test 'uptime'
+
<!-- .slide: class="tetris-two" -->
---
@@ -527,6 +535,12 @@ consists of two functions
- `calculate_uptime()`
- `read_proc_uptime()`
+note:
+Uptime consists of two functions
+
+- `calculate_uptime()`
+- `read_proc_uptime()`
+
<!-- .slide: class="tetris-two" -->
---
@@ -535,6 +549,9 @@ consists of two functions
`calculate_uptime()` calls `read_proc_uptime()`
+note:
+`calculate_uptime()` calls `read_proc_uptime()`
+
<!-- .slide: class="tetris-two" -->
---
@@ -543,6 +560,9 @@ consists of two functions
<img src="img/unit_test_subfunction.svg" border="0" />
+note:
+## Unit test with a subfunction
+
<!-- .slide: class="tetris-two" -->
---
@@ -551,6 +571,9 @@ consists of two functions
<img src="img/unit_test_uptime.svg" border="0" />
+note:
+## Uptime example
+
<!-- .slide: class="tetris-two" -->
---
@@ -559,6 +582,9 @@ consists of two functions
<img src="img/unit_test_uptime_wont_work.svg" border="0" />
+note:
+## This doesn't work for our example!
+
<!-- .slide: class="tetris-two" -->
---
@@ -567,12 +593,20 @@ consists of two functions
- `/proc/uptime` constantly ticks!
+note:
+# Why?
+
+- `/proc/uptime` constantly ticks!
+
<!-- .slide: class="tetris-two center" -->
---
# Solution: We need mocking!
+note:
+# Solution: We need mocking!
+
<!-- .slide: class="tetris-two center" -->
---
@@ -612,6 +646,9 @@ into the unit test, e.g. randomness, interfaces not available in test env.
<img src="img/unit_test_mock_function.svg" border="0" />
+note:
+Mocking test
+
<!-- .slide: class="tetris-two" -->
---
@@ -620,6 +657,9 @@ into the unit test, e.g. randomness, interfaces not available in test env.
<img src="img/unit_test_mock_function_call.svg" border="0" />
+note:
+Now we need to rewire everything
+
<!-- .slide: class="tetris-two" -->
---
@@ -632,6 +672,9 @@ Use a wrapper function for a symbol.
Supported by `ld.bfd`, `ld.gold` and `llvm-ld`
+note:
+For this we use a GNU linker feature
+
<!-- .slide: class="tetris-two center" -->
---