|
1 | 1 | local N = require('NTest')("pixbuf_1")
|
2 | 2 |
|
3 |
| -local buffer, buffer1, buffer2, buffer3 |
4 |
| - |
5 | 3 | local function initBuffer(buf, ...)
|
6 |
| - --local i,v |
7 | 4 | for i,v in ipairs({...}) do
|
8 | 5 | buf:set(i, v, v*2, v*3, v*4)
|
9 | 6 | end
|
@@ -55,7 +52,7 @@ N.test('replace correctly', function()
|
55 | 52 | end)
|
56 | 53 |
|
57 | 54 | N.test('replace correctly issue #2921', function()
|
58 |
| - buffer = pixbuf.newBuffer(5, 3) |
| 55 | + local buffer = pixbuf.newBuffer(5, 3) |
59 | 56 | buffer:replace(string.char(3,255,165,33,0,244,12,87,255), -7)
|
60 | 57 | ok(eq(buffer:dump(), string.char(3,255,165,33,0,244,12,87,255,0,0,0,0,0,0)), "RGBW")
|
61 | 58 | end)
|
@@ -188,8 +185,8 @@ N.test('shift LOGICAL', function()
|
188 | 185 | end)
|
189 | 186 |
|
190 | 187 | N.test('shift LOGICAL issue #2946', function()
|
191 |
| - buffer1 = pixbuf.newBuffer(4, 4) |
192 |
| - buffer2 = pixbuf.newBuffer(4, 4) |
| 188 | + local buffer1 = pixbuf.newBuffer(4, 4) |
| 189 | + local buffer2 = pixbuf.newBuffer(4, 4) |
193 | 190 |
|
194 | 191 | initBuffer(buffer1,7,8,9,12)
|
195 | 192 | initBuffer(buffer2,0,0,0,0)
|
@@ -275,11 +272,11 @@ N.test('map', function()
|
275 | 272 | buffer1:map(function(a,b,c,d) return b,a,c,d end)
|
276 | 273 | ok(eq("BACDBACDBACDBACD", buffer1:dump()), "swizzle")
|
277 | 274 |
|
278 |
| - buffer2 = pixbuf.newBuffer(4, 1) |
| 275 | + local buffer2 = pixbuf.newBuffer(4, 1) |
279 | 276 | buffer2:map(function(b,a,c,d) return c end, buffer1) -- luacheck: ignore
|
280 | 277 | ok(eq("CCCC", buffer2:dump()), "projection")
|
281 | 278 |
|
282 |
| - buffer3 = pixbuf.newBuffer(4, 3) |
| 279 | + local buffer3 = pixbuf.newBuffer(4, 3) |
283 | 280 | buffer3:map(function(b,a,c,d) return a,b,d end, buffer1) -- luacheck: ignore
|
284 | 281 | ok(eq("ABDABDABDABD", buffer3:dump()), "projection 2")
|
285 | 282 |
|
|
0 commit comments