From 27f41e624c39f661f917c20b58daf6637ada0982 Mon Sep 17 00:00:00 2001 From: Damien George Date: Thu, 23 Jan 2020 13:18:34 +1100 Subject: [PATCH] tests/unix: Add coverage test for mp_obj_new_exception_args. Because it's no longer called anywhere in the code. --- ports/unix/coverage.c | 3 +++ tests/unix/extra_coverage.py.exp | 1 + 2 files changed, 4 insertions(+) diff --git a/ports/unix/coverage.c b/ports/unix/coverage.c index 233c6211e9..e4d2d68fc9 100644 --- a/ports/unix/coverage.c +++ b/ports/unix/coverage.c @@ -387,6 +387,9 @@ STATIC mp_obj_t extra_coverage(void) { } else { mp_obj_print_exception(&mp_plat_print, MP_OBJ_FROM_PTR(nlr.ret_val)); } + + // call mp_obj_new_exception_args (it's a part of the public C API and not used in the core) + mp_obj_print_exception(&mp_plat_print, mp_obj_new_exception_args(&mp_type_ValueError, 0, NULL)); } // warning diff --git a/tests/unix/extra_coverage.py.exp b/tests/unix/extra_coverage.py.exp index a41f227be7..9c3b036b93 100644 --- a/tests/unix/extra_coverage.py.exp +++ b/tests/unix/extra_coverage.py.exp @@ -58,6 +58,7 @@ TypeError: unsupported types for __divmod__: 'str', 'str' 2 OverflowError: overflow converting long int to machine word OverflowError: overflow converting long int to machine word +ValueError: Warning: test # format float ?