diff options
| author | Damien George <damien.p.george@gmail.com> | 2018-03-08 12:49:31 +1100 |
|---|---|---|
| committer | Damien George <damien.p.george@gmail.com> | 2018-03-08 12:49:31 +1100 |
| commit | 0b88a9f02ebbe3142609fa134e118e47c8008175 (patch) | |
| tree | 364a1350ffd458879d0c87561c9e60f23890c19c /ports/unix/coverage.c | |
| parent | 250b24fe3668968e305f37ebb4dcd55d57ae65d1 (diff) | |
unix/coverage: Allow coverage tests to pass with debugging disabled.
Diffstat (limited to 'ports/unix/coverage.c')
| -rw-r--r-- | ports/unix/coverage.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ports/unix/coverage.c b/ports/unix/coverage.c index 33533ad86..eba84f38b 100644 --- a/ports/unix/coverage.c +++ b/ports/unix/coverage.c @@ -152,7 +152,11 @@ STATIC mp_obj_t extra_coverage(void) { mp_printf(&mp_plat_print, "%.2s %.3s\n", "abc", "abc"); // fixed string precision mp_printf(&mp_plat_print, "%.*s\n", -1, "abc"); // negative string precision mp_printf(&mp_plat_print, "%b %b\n", 0, 1); // bools + #ifndef NDEBUG mp_printf(&mp_plat_print, "%s\n", NULL); // null string + #else + mp_printf(&mp_plat_print, "(null)\n"); // without debugging mp_printf won't check for null + #endif mp_printf(&mp_plat_print, "%d\n", 0x80000000); // should print signed mp_printf(&mp_plat_print, "%u\n", 0x80000000); // should print unsigned mp_printf(&mp_plat_print, "%x\n", 0x80000000); // should print unsigned |
