summaryrefslogtreecommitdiffstatshomepage
path: root/unix/coverage.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2016-02-01 15:08:42 +0000
committerDamien George <damien.p.george@gmail.com>2016-02-01 15:08:42 +0000
commit9e677114e4aba8fdb417350a87ce1af33cef127f (patch)
tree8b0bb9772830414b7f76893dfe8147220d25db28 /unix/coverage.c
parent331a48195d325b9557175056e2c3650ef496d862 (diff)
downloadmicropython-9e677114e4aba8fdb417350a87ce1af33cef127f.tar.gz
micropython-9e677114e4aba8fdb417350a87ce1af33cef127f.zip
py/mpprint: Fix sign extension when printf'ing %u, %x and %X.
Diffstat (limited to 'unix/coverage.c')
-rw-r--r--unix/coverage.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/unix/coverage.c b/unix/coverage.c
index 94d0ad4cae..9d53725543 100644
--- a/unix/coverage.c
+++ b/unix/coverage.c
@@ -22,6 +22,10 @@ STATIC mp_obj_t extra_coverage(void) {
mp_printf(&mp_plat_print, "%b %b\n", 0, 1); // bools
mp_printf(&mp_plat_print, "%s\n", NULL); // null string
mp_printf(&mp_plat_print, "%t\n"); // non-format char
+ 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
+ mp_printf(&mp_plat_print, "%X\n", 0x80000000); // should print unsigned
}
// vstr