fun testLowLevel()

in plot-api/src/jvmTest/kotlin/org/jetbrains/letsPlot/util/pngj/DeflatedChunk2Test.kt [33:85]


    fun testLowLevel() {
        val rowsize = 3
        val nrows = 2
        var row = -1
        val c = DeflatedChunksSet("XXXX", false, rowsize, rowsize)
        c.processBytes(compressed, 0, 4)
        val sb = StringBuilder()
        while (c.isRowReady) {
            row++
            sb.append(
                (c.state.toString() + " " + c.bytesIn + " "
                        + TestSupport.showRow(c.row!!, c.rowFilled, row)) + ", "
            )
            c.prepareForNextRow(if (row == nrows) 0 else rowsize)
        }
        c.processBytes(compressed, 4, 2)
        while (c.isRowReady) {
            row++
            sb.append(
                (c.state.toString() + " " + c.bytesIn + " "
                        + TestSupport.showRow(c.row!!, c.rowFilled, row)) + ", "
            )
            c.prepareForNextRow(if (row == nrows) 0 else rowsize)
        }
        c.processBytes(compressed, 6, 2)
        while (c.isRowReady) {
            row++
            sb.append(
                (c.state.toString() + " " + c.bytesIn + " "
                        + TestSupport.showRow(c.row!!, c.rowFilled, row)) + ", "
            )
            c.prepareForNextRow(if (row == nrows) 0 else rowsize)
        }
        c.processBytes(compressed, 8, 2)
        while (c.isRowReady) {
            row++
            sb.append(
                (c.state.toString() + " " + c.bytesIn + " "
                        + TestSupport.showRow(c.row!!, c.rowFilled, row)) + ", "
            )
            c.prepareForNextRow(if (row == nrows - 1) 0 else rowsize)
        }
        c.processBytes(compressed, 10, 2)
        while (c.isRowReady) {
            row++
            sb.append(
                (c.state.toString() + " " + c.bytesIn + " "
                        + TestSupport.showRow(c.row!!, c.rowFilled, row)) + ", "
            )
            c.prepareForNextRow(if (row == nrows) 0 else rowsize)
        }
        TestCase.assertEquals("ROW_READY 6 r=0[  0| 42  43], ROW_READY 10 r=1[  0| 44  41], ", sb.toString())
    }