Updated asserts sample
This commit is contained in:
parent
8ac4911f19
commit
a8ecd27427
4 changed files with 20 additions and 10 deletions
|
@ -6,6 +6,8 @@ Test(asserts, base) {
|
|||
|
||||
cr_assert(true, "Assertions may take failure messages");
|
||||
|
||||
cr_assert(true, "Or even %d format string %s", 1, "with parameters");
|
||||
|
||||
cr_expect(false, "assert is fatal, expect isn't");
|
||||
cr_assert(false, "This assert runs");
|
||||
cr_assert(false, "This does not");
|
||||
|
@ -17,6 +19,9 @@ Test(asserts, old_school) {
|
|||
}
|
||||
|
||||
Test(asserts, string) {
|
||||
cr_assert_str_empty("");
|
||||
cr_assert_str_not_empty("foo");
|
||||
|
||||
cr_assert_str_eq("hello", "hello");
|
||||
cr_assert_str_neq("hello", "olleh");
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
[[0;34m----[0m] [0;1masserts.c[0m:[0;31m9[0m: Assertion failed: assert is fatal, expect isn't
|
||||
[[0;34m----[0m] [0;1masserts.c[0m:[0;31m10[0m: Assertion failed: This assert runs
|
||||
[[0;34m----[0m] [0;1masserts.c[0m:[0;31m11[0m: Assertion failed: assert is fatal, expect isn't
|
||||
[[0;34m----[0m] [0;1masserts.c[0m:[0;31m12[0m: Assertion failed: This assert runs
|
||||
[[0;31mFAIL[0m] asserts::base: (0.00s)
|
||||
[[0;34m----[0m] [0;1masserts.c[0m:[0;31m15[0m: Assertion failed: You can fail an assertion with a message from anywhere
|
||||
[[0;34m----[0m] [0;1masserts.c[0m:[0;31m16[0m: Assertion failed: The condition for this assertion were not met.
|
||||
[[0;34m----[0m] [0;1masserts.c[0m:[0;31m17[0m: Assertion failed: You can fail an assertion with a message from anywhere
|
||||
[[0;34m----[0m] [0;1masserts.c[0m:[0;31m18[0m: Assertion failed: The condition for this assertion were not met.
|
||||
[[0;31mFAIL[0m] asserts::old_school: (0.00s)
|
||||
[[0;34m====[0m] [0;1mSynthesis: Tested: [0;34m6[0;1m | Passing: [0;32m4[0;1m | Failing: [0;31m2[0;1m | Crashing: [0;31m0[0;1m [0m
|
||||
|
|
|
@ -8,6 +8,8 @@ Test(asserts, base) {
|
|||
|
||||
cr_assert(true, "Assertions may take failure messages");
|
||||
|
||||
cr_assert(true, "Or even %d format string %s", 1, "with parameters");
|
||||
|
||||
cr_expect(false, "assert is fatal, expect isn't");
|
||||
cr_assert(false, "This assert runs");
|
||||
cr_assert(false, "This does not");
|
||||
|
@ -19,6 +21,9 @@ Test(asserts, old_school) {
|
|||
}
|
||||
|
||||
Test(asserts, string) {
|
||||
cr_assert_str_empty("");
|
||||
cr_assert_str_not_empty("foo");
|
||||
|
||||
cr_assert_str_eq("hello", "hello");
|
||||
cr_assert_str_neq("hello", "olleh");
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
[[0;34m----[0m] [0;1masserts.cc[0m:[0;31m78[0m: Assertion failed: (&s1)[0 .. 2] == (&s2)[0 .. 2]
|
||||
[[0;34m----[0m] [0;1masserts.cc[0m:[0;31m83[0m: Assertion failed: (&s1)[0 .. 2] == (&s2)[0 .. 2]
|
||||
[[0;31mFAIL[0m] asserts::array: (0.00s)
|
||||
[[0;34m----[0m] [0;1masserts.cc[0m:[0;31m11[0m: Assertion failed: assert is fatal, expect isn't
|
||||
[[0;34m----[0m] [0;1masserts.cc[0m:[0;31m12[0m: Assertion failed: This assert runs
|
||||
[[0;34m----[0m] [0;1masserts.cc[0m:[0;31m13[0m: Assertion failed: assert is fatal, expect isn't
|
||||
[[0;34m----[0m] [0;1masserts.cc[0m:[0;31m14[0m: Assertion failed: This assert runs
|
||||
[[0;31mFAIL[0m] asserts::base: (0.00s)
|
||||
[[0;34m----[0m] [0;1masserts.cc[0m:[0;31m84[0m: Assertion failed: The condition for this assertion were not met.
|
||||
[[0;34m----[0m] [0;1masserts.cc[0m:[0;31m89[0m: Assertion failed: The condition for this assertion were not met.
|
||||
[[0;31mFAIL[0m] asserts::exception: (0.00s)
|
||||
[[0;34m----[0m] [0;1masserts.cc[0m:[0;31m17[0m: Assertion failed: You can fail an assertion with a message from anywhere
|
||||
[[0;34m----[0m] [0;1masserts.cc[0m:[0;31m18[0m: Assertion failed: The condition for this assertion were not met.
|
||||
[[0;34m----[0m] [0;1masserts.cc[0m:[0;31m19[0m: Assertion failed: You can fail an assertion with a message from anywhere
|
||||
[[0;34m----[0m] [0;1masserts.cc[0m:[0;31m20[0m: Assertion failed: The condition for this assertion were not met.
|
||||
[[0;31mFAIL[0m] asserts::old_school: (0.00s)
|
||||
[[0;34m====[0m] [0;1mSynthesis: Tested: [0;34m7[0;1m | Passing: [0;32m3[0;1m | Failing: [0;31m4[0;1m | Crashing: [0;31m0[0;1m [0m
|
||||
|
|
Loading…
Add table
Reference in a new issue