sim: Use image number instead of slot in dep test
When generating dependencies, we were using the slot number instead of
the image number to determine which dependencies to mark invalid. Fix
this, so that we can test configurations where one image is upgradeable
and the other not.
Signed-off-by: David Brown <david.brown@linaro.org>
Signed-off-by: Fabio Utzig <utzig@apache.org>
diff --git a/sim/src/depends.rs b/sim/src/depends.rs
index 9036d8d..c0d5529 100644
--- a/sim/src/depends.rs
+++ b/sim/src/depends.rs
@@ -101,7 +101,7 @@
}
fn my_deps(&self, _offset: usize, slot: usize) -> Vec<ImageVersion> {
- match self.test.depends[slot] {
+ match self.test.depends[self.number] {
DepType::Nothing => vec![],
DepType::Correct => vec![
ImageVersion::new_synthetic(self.other_id(), slot as u8, 0)