MCPcopy
hub / github.com/zxing-js/library / testMask

Function testMask

src/test/core/qrcode/decoder/DataMask.spec.ts:104–115  ·  view source on GitHub ↗
(mask: QRCodeDataMask, dimension: number /*int*/, condition: MaskCondition)

Source from the content-addressed store, hash-verified

102 }
103
104 function testMask(mask: QRCodeDataMask, dimension: number /*int*/, condition: MaskCondition): void {
105 const bits = new BitMatrix(dimension);
106 mask.unmaskBitMatrix(bits, dimension);
107 for (let i: number /*int*/ = 0; i < dimension; i++) {
108 for (let j: number /*int*/ = 0; j < dimension; j++) {
109 assert.strictEqual(
110 bits.get(j, i),
111 condition.isMasked(i, j),
112 '(' + i + ',' + j + ')');
113 }
114 }
115 }
116
117});

Callers 1

testMaskAcrossDimensionsFunction · 0.85

Calls 3

getMethod · 0.95
isMaskedMethod · 0.80
unmaskBitMatrixMethod · 0.45

Tested by

no test coverage detected