diff options
| author | cirakg <cirakg@cirakg.xyz> | 2026-10-20 11:24:58 +0200 |
|---|---|---|
| committer | cirakg <cirakg@cirakg.xyz> | 2026-10-20 11:24:58 +0200 |
| commit | 1251aab9f8f9f38aa5bdefd4fed1f58236166cf8 (patch) | |
| tree | d9824a2430cff9f6659a5b14b6e437d6b1568b87 /test/codes/CodeCacheTest.mc | |
| parent | d94eb32c80d2dbf00a45d7e69804f8247240a769 (diff) | |
test(codes): compare Data Matrix and PDF417 with references and decode them, also from screenshots
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'test/codes/CodeCacheTest.mc')
| -rw-r--r-- | test/codes/CodeCacheTest.mc | 10 |
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); } |
