aboutsummaryrefslogtreecommitdiff
path: root/test/codes/CodeCacheTest.mc
diff options
context:
space:
mode:
Diffstat (limited to 'test/codes/CodeCacheTest.mc')
-rw-r--r--test/codes/CodeCacheTest.mc10
1 files changed, 7 insertions, 3 deletions
diff --git a/test/codes/CodeCacheTest.mc b/test/codes/CodeCacheTest.mc
index e09d902..812acc9 100644
--- a/test/codes/CodeCacheTest.mc
+++ b/test/codes/CodeCacheTest.mc
@@ -39,7 +39,7 @@ function codeCacheOfLockedEntriesNeedsTheSession(logger as Test.Logger) as Boole
e.type = Codes.QR;
e.locked = true;
var id = vault.add(e);
- vault.saveCodeCache(id, [3, 1, 4, 0xE0]b);
+ vault.saveCodeCache(id, [3, 1, 4, 1, 0xE0]b);
vault.lock();
var code = 0;
try {
@@ -49,6 +49,10 @@ function codeCacheOfLockedEntriesNeedsTheSession(logger as Test.Logger) as Boole
}
StorageFixtures.unlock(vault, StorageFixtures.PIN);
var back = vault.loadCodeCache(id);
- return code == VaultError.LOCKED && back != null && Bytes.equal(back, [3, 1, 4, 0xE0]b)
- && Codes.Matrix.fromBytes([3, 1, 4, 0xE0]b) != null && Codes.Matrix.fromBytes([3, 1, 4]b) == null;
+ var pdf = new Codes.Matrix(3, 2, 2, [1, 0, 1, 0, 1, 1]b);
+ pdf.rowHeight = 3;
+ var round = Codes.Matrix.fromBytes(pdf.toBytes());
+ return code == VaultError.LOCKED && back != null && Bytes.equal(back, [3, 1, 4, 1, 0xE0]b)
+ && Codes.Matrix.fromBytes([3, 1, 4, 1, 0xE0]b) != null && Codes.Matrix.fromBytes([3, 1, 4]b) == null
+ && round != null && round.rowHeight == 3 && Bytes.equal(round.modules, [1, 0, 1, 0, 1, 1]b);
}