Add simple status write test without interruption

This test marks the status write regions as a bad region,
causing errors, but it is allowed to complete the swap. On
restart the firmware in slot0 should be validated and work.

Signed-off-by: Fabio Utzig <utzig@apache.org>
diff --git a/sim/src/lib.rs b/sim/src/lib.rs
index e22984e..cddb48c 100644
--- a/sim/src/lib.rs
+++ b/sim/src/lib.rs
@@ -173,6 +173,7 @@
         assert_eq!(slot1_base, slot0_base + slot0_len);
         assert_eq!(scratch_base, slot1_base + slot1_len);
 
+        // NOTE: not accounting "swap_size" because it is not used by sim...
         let offset_from_end = c::boot_magic_sz() + c::boot_max_align() * 2;
 
         // Construct a primary image.
@@ -295,6 +296,8 @@
         failed |= images.run_perm_with_random_fails(5);
         failed |= images.run_norevert();
 
+        failed |= images.run_with_status_fails_complete();
+
         //show_flash(&flash);
 
         if failed {
diff --git a/sim/tests/core.rs b/sim/tests/core.rs
index 5487939..409f635 100644
--- a/sim/tests/core.rs
+++ b/sim/tests/core.rs
@@ -27,3 +27,4 @@
 sim_test!(perm_with_fails, make_image, run_perm_with_fails);
 sim_test!(perm_with_random_fails, make_image, run_perm_with_random_fails_5);
 sim_test!(norevert, make_image, run_norevert);
+sim_test!(status_write_fails_complete, make_image, run_with_status_fails_complete);