Fix test/revert upgrade flash count
When doing a test with fails, the total number of flash accesses is
first calculated doing an upgrade without fails, which is then used to
fail/resume at all test points. The count was always considering the
setting of a permanent upgrade, which added 1 to the total count in a
non-permanent upgrade. This amount was being discounted when running
the test/revert with fails, although the discount was only ok for single
images. This adds a new image constructor that does not run a permanent
upgrade and thus gets the correct number of flash accesses for a
test/revert no matter how many images are being tested.
Signed-off-by: Fabio Utzig <utzig@apache.org>
diff --git a/sim/tests/core.rs b/sim/tests/core.rs
index 5aa29ae..3253ddf 100644
--- a/sim/tests/core.rs
+++ b/sim/tests/core.rs
@@ -21,7 +21,7 @@
sim_test!(bad_secondary_slot, make_bad_secondary_slot_image, run_signfail_upgrade);
sim_test!(norevert_newimage, make_no_upgrade_image, run_norevert_newimage);
sim_test!(basic_revert, make_image, run_basic_revert);
-sim_test!(revert_with_fails, make_image, run_revert_with_fails);
+sim_test!(revert_with_fails, make_non_permanent_image, run_revert_with_fails);
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);