From 8124804d49b95b8dd610a5b5f8b1e870a7f09f82 Mon Sep 17 00:00:00 2001
From: ell <77150506+ellraiser@users.noreply.github.com>
Date: Thu, 16 Nov 2023 19:22:40 +0000
Subject: [PATCH] more graphics + some physics tests
- added obj tests for graphics.SpriteBatch, and graphics.Video
- added obj tests for physics.World
- added test for setStencilMode and removed deprecated stencil+setStencilTest
- added graphics.drawInstanced
- fixed deprecated physic shape calls (body now added as first param)
---
testing/examples/lovetest_runAllTests.html | 2 +-
testing/examples/lovetest_runAllTests.md | 34 +-
testing/examples/lovetest_runAllTests.xml | 609 +++++++++---------
.../love.test.graphics.SpriteBatch-1.png | Bin 0 -> 96 bytes
.../love.test.graphics.SpriteBatch-2.png | Bin 0 -> 111 bytes
.../love.test.graphics.SpriteBatch-3.png | Bin 0 -> 112 bytes
.../love.test.graphics.SpriteBatch-4.png | Bin 0 -> 72 bytes
.../love.test.graphics.SpriteBatch-5.png | Bin 0 -> 209 bytes
.../expected/love.test.graphics.Video-1.png | Bin 0 -> 197 bytes
.../love.test.graphics.drawInstanced-1.png | Bin 0 -> 369 bytes
...> love.test.graphics.setStencilMode-1.png} | Bin
testing/readme.md | 24 +-
testing/tests/graphics.lua | 226 ++++++-
testing/tests/physics.lua | 120 +++-
14 files changed, 632 insertions(+), 383 deletions(-)
create mode 100644 testing/output/expected/love.test.graphics.SpriteBatch-1.png
create mode 100644 testing/output/expected/love.test.graphics.SpriteBatch-2.png
create mode 100644 testing/output/expected/love.test.graphics.SpriteBatch-3.png
create mode 100644 testing/output/expected/love.test.graphics.SpriteBatch-4.png
create mode 100644 testing/output/expected/love.test.graphics.SpriteBatch-5.png
create mode 100644 testing/output/expected/love.test.graphics.Video-1.png
create mode 100644 testing/output/expected/love.test.graphics.drawInstanced-1.png
rename testing/output/expected/{love.test.graphics.setStencilTest-1.png => love.test.graphics.setStencilMode-1.png} (100%)
diff --git a/testing/examples/lovetest_runAllTests.html b/testing/examples/lovetest_runAllTests.html
index b972d61eb..906348df6 100644
--- a/testing/examples/lovetest_runAllTests.html
+++ b/testing/examples/lovetest_runAllTests.html
@@ -1 +1 @@
-
🔴 love.test
- 🟢 282 Tests
- 🔴 1 Failures
- 🟡 20 Skipped
- 9.881s
🟢 love.audio
- 🟢 28 Tests
- 🔴 0 Failures
- 🟡 0 Skipped
- 0.857s
| Method | Time | Details |
| 🟢 | RecordingDevice | 0.394s | |
| 🟢 | Source | 0.019s | |
| 🟢 | getActiveEffects | 0.017s | |
| 🟢 | getActiveSourceCount | 0.018s | |
| 🟢 | getDistanceModel | 0.017s | |
| 🟢 | getDopplerScale | 0.017s | |
| 🟢 | getEffect | 0.017s | |
| 🟢 | getMaxSceneEffects | 0.017s | |
| 🟢 | getMaxSourceEffects | 0.016s | |
| 🟢 | getOrientation | 0.016s | |
| 🟢 | getPosition | 0.017s | |
| 🟢 | getRecordingDevices | 0.017s | |
| 🟢 | getVelocity | 0.017s | |
| 🟢 | getVolume | 0.018s | |
| 🟢 | isEffectsSupported | 0.016s | |
| 🟢 | newQueueableSource | 0.017s | |
| 🟢 | newSource | 0.018s | |
| 🟢 | pause | 0.018s | |
| 🟢 | play | 0.019s | |
| 🟢 | setDistanceModel | 0.017s | |
| 🟢 | setDopplerScale | 0.016s | |
| 🟢 | setEffect | 0.017s | |
| 🟢 | setMixWithSystem | 0.016s | |
| 🟢 | setOrientation | 0.017s | |
| 🟢 | setPosition | 0.017s | |
| 🟢 | setVelocity | 0.017s | |
| 🟢 | setVolume | 0.017s | |
| 🟢 | stop | 0.018s | |
🟢 love.data
- 🟢 12 Tests
- 🔴 0 Failures
- 🟡 0 Skipped
- 0.139s
| Method | Time | Details |
| 🟢 | ByteData | 0.017s | |
| 🟢 | CompressedData | 0.017s | |
| 🟢 | compress | 0.017s | |
| 🟢 | decode | 0.017s | |
| 🟢 | decompress | 0.018s | |
| 🟢 | encode | 0.019s | |
| 🟢 | getPackedSize | 0.011s | |
| 🟢 | hash | 0.016s | |
| 🟢 | newByteData | 0.001s | |
| 🟢 | newDataView | 0.002s | |
| 🟢 | pack | 0.001s | |
| 🟢 | unpack | 0.002s | |
🟢 love.event
- 🟢 4 Tests
- 🔴 0 Failures
- 🟡 2 Skipped
- 0.010s
| Method | Time | Details |
| 🟢 | clear | 0.002s | |
| 🟢 | poll | 0.001s | |
| 🟡 | pump | 0.002s | used internally |
| 🟢 | push | 0.002s | |
| 🟢 | quit | 0.003s | |
| 🟡 | wait | 0.001s | used internally |
🟢 love.filesystem
- 🟢 29 Tests
- 🔴 0 Failures
- 🟡 2 Skipped
- 0.068s
| Method | Time | Details |
| 🟢 | File | 0.002s | |
| 🟢 | FileData | 0.003s | |
| 🟢 | append | 0.002s | |
| 🟢 | areSymlinksEnabled | 0.001s | |
| 🟢 | createDirectory | 0.002s | |
| 🟢 | getAppdataDirectory | 0.001s | |
| 🟢 | getCRequirePath | 0.001s | |
| 🟢 | getDirectoryItems | 0.002s | |
| 🟢 | getIdentity | 0.002s | |
| 🟢 | getInfo | 0.007s | |
| 🟢 | getRealDirectory | 0.002s | |
| 🟢 | getRequirePath | 0.001s | |
| 🟢 | getSaveDirectory | 0.001s | |
| 🟡 | getSource | 0.002s | used internally |
| 🟢 | getSourceBaseDirectory | 0.002s | |
| 🟢 | getUserDirectory | 0.002s | |
| 🟢 | getWorkingDirectory | 0.007s | |
| 🟢 | isFused | 0.002s | |
| 🟢 | lines | 0.002s | |
| 🟢 | load | 0.002s | |
| 🟢 | mount | 0.002s | |
| 🟢 | newFileData | 0.002s | |
| 🟢 | openFile | 0.002s | |
| 🟢 | read | 0.002s | |
| 🟢 | remove | 0.002s | |
| 🟢 | setCRequirePath | 0.001s | |
| 🟢 | setIdentity | 0.001s | |
| 🟢 | setRequirePath | 0.006s | |
| 🟡 | setSource | 0.001s | used internally |
| 🟢 | unmount | 0.002s | |
| 🟢 | write | 0.002s | |
🔴 love.font
- 🟢 6 Tests
- 🔴 1 Failures
- 🟡 0 Skipped
- 0.015s
| Method | Time | Details |
| 🔴 | GlyphData | 0.002s | assert 8 [check glyph number] expected '97' got '0' |
| 🟢 | Rasterizer | 0.002s | |
| 🟢 | newBMFontRasterizer | 0.002s | |
| 🟢 | newGlyphData | 0.006s | |
| 🟢 | newImageRasterizer | 0.002s | |
| 🟢 | newRasterizer | 0.002s | |
| 🟢 | newTrueTypeRasterizer | 0.002s | |
🟢 love.graphics
- 🟢 99 Tests
- 🔴 0 Failures
- 🟡 6 Skipped
- 0.294s
| Method | Time | Details |
| 🟢 | Canvas | 0.003s | |
| 🟢 | Font | 0.004s |  Expected  Actual  Expected  Actual |
| 🟢 | Image | 0.006s |  Expected  Actual |
| 🟡 | Mesh | 0.001s | test class needs writing |
| 🟡 | ParticleSystem | 0.001s | test class needs writing |
| 🟢 | Quad | 0.003s |  Expected  Actual |
| 🟢 | Shader | 0.013s |  Expected  Actual |
| 🟡 | SpriteBatch | 0.001s | test class needs writing |
| 🟢 | Text | 0.003s |  Expected  Actual |
| 🟡 | Video | 0.001s | test class needs writing |
| 🟢 | applyTransform | 0.004s |  Expected  Actual |
| 🟢 | arc | 0.003s |  Expected  Actual  Expected  Actual  Expected  Actual |
| 🟢 | captureScreenshot | 0.020s | |
| 🟢 | circle | 0.005s |  Expected  Actual |
| 🟢 | clear | 0.002s |  Expected  Actual |
| 🟡 | discard | 0.001s | cant test this worked |
| 🟢 | draw | 0.002s |  Expected  Actual |
| 🟡 | drawInstanced | 0.002s | test class needs writing |
| 🟢 | drawLayer | 0.003s |  Expected  Actual |
| 🟢 | ellipse | 0.002s |  Expected  Actual |
| 🟢 | flushBatch | 0.004s | |
| 🟢 | getBackgroundColor | 0.001s | |
| 🟢 | getBlendMode | 0.001s | |
| 🟢 | getCanvas | 0.001s | |
| 🟢 | getColor | 0.001s | |
| 🟢 | getColorMask | 0.001s | |
| 🟢 | getDPIScale | 0.002s | |
| 🟢 | getDefaultFilter | 0.001s | |
| 🟢 | getDepthMode | 0.004s | |
| 🟢 | getDimensions | 0.002s | |
| 🟢 | getFont | 0.001s | |
| 🟢 | getFrontFaceWinding | 0.002s | |
| 🟢 | getHeight | 0.001s | |
| 🟢 | getLineJoin | 0.002s | |
| 🟢 | getLineStyle | 0.002s | |
| 🟢 | getLineWidth | 0.001s | |
| 🟢 | getMeshCullMode | 0.001s | |
| 🟢 | getPixelDimensions | 0.005s | |
| 🟢 | getPixelHeight | 0.001s | |
| 🟢 | getPixelWidth | 0.001s | |
| 🟢 | getPointSize | 0.001s | |
| 🟢 | getRendererInfo | 0.002s | |
| 🟢 | getScissor | 0.002s | |
| 🟢 | getShader | 0.002s | |
| 🟢 | getStackDepth | 0.002s | |
| 🟢 | getStats | 0.002s | |
| 🟢 | getStencilMode | 0.001s | |
| 🟢 | getSupported | 0.002s | |
| 🟢 | getSystemLimits | 0.005s | |
| 🟢 | getTextureFormats | 0.002s | |
| 🟢 | getTextureTypes | 0.001s | |
| 🟢 | getWidth | 0.001s | |
| 🟢 | intersectScissor | 0.002s |  Expected  Actual |
| 🟢 | inverseTransformPoint | 0.002s | |
| 🟢 | isActive | 0.001s | |
| 🟢 | isGammaCorrect | 0.006s | |
| 🟢 | isWireframe | 0.001s | |
| 🟢 | line | 0.003s |  Expected  Actual |
| 🟢 | newArrayImage | 0.007s | |
| 🟢 | newCanvas | 0.002s | |
| 🟢 | newCubeImage | 0.003s | |
| 🟢 | newFont | 0.002s | |
| 🟢 | newImage | 0.002s | |
| 🟢 | newImageFont | 0.002s | |
| 🟢 | newMesh | 0.002s | |
| 🟢 | newParticleSystem | 0.002s | |
| 🟢 | newQuad | 0.002s | |
| 🟢 | newShader | 0.009s | |
| 🟢 | newSpriteBatch | 0.002s | |
| 🟢 | newTextBatch | 0.002s | |
| 🟢 | newVideo | 0.004s | |
| 🟢 | newVolumeImage | 0.002s | |
| 🟢 | origin | 0.002s |  Expected  Actual |
| 🟢 | points | 0.003s |  Expected  Actual |
| 🟢 | polygon | 0.002s |  Expected  Actual |
| 🟢 | pop | 0.002s |  Expected  Actual |
| 🟢 | print | 0.002s |  Expected  Actual |
| 🟢 | printf | 0.002s |  Expected  Actual |
| 🟢 | push | 0.007s |  Expected  Actual |
| 🟢 | rectangle | 0.002s |  Expected  Actual  Expected  Actual |
| 🟢 | replaceTransform | 0.002s |  Expected  Actual |
| 🟢 | reset | 0.002s | |
| 🟢 | rotate | 0.002s |  Expected  Actual |
| 🟢 | scale | 0.002s | |
| 🟢 | setBackgroundColor | 0.002s | |
| 🟢 | setBlendMode | 0.003s |  Expected  Actual |
| 🟢 | setCanvas | 0.002s |  Expected  Actual |
| 🟢 | setColor | 0.002s |  Expected  Actual |
| 🟢 | setColorMask | 0.002s |  Expected  Actual |
| 🟢 | setDefaultFilter | 0.001s | |
| 🟢 | setDepthMode | 0.002s | |
| 🟢 | setFont | 0.003s |  Expected  Actual |
| 🟢 | setFrontFaceWinding | 0.002s | |
| 🟢 | setLineJoin | 0.003s |  Expected  Actual |
| 🟢 | setLineStyle | 0.002s |  Expected  Actual |
| 🟢 | setLineWidth | 0.002s |  Expected  Actual |
| 🟢 | setMeshCullMode | 0.002s | |
| 🟢 | setScissor | 0.002s |  Expected  Actual |
| 🟢 | setShader | 0.010s |  Expected  Actual |
| 🟢 | setStencilTest | 0.003s |  Expected  Actual |
| 🟢 | setWireframe | 0.002s |  Expected  Actual |
| 🟢 | shear | 0.003s |  Expected  Actual  Expected  Actual |
| 🟢 | transformPoint | 0.002s | |
| 🟢 | translate | 0.007s |  Expected  Actual |
| 🟢 | validateShader | 0.005s | |
🟢 love.image
- 🟢 5 Tests
- 🔴 0 Failures
- 🟡 0 Skipped
- 0.011s
| Method | Time | Details |
| 🟢 | CompressedImageData | 0.002s | |
| 🟢 | ImageData | 0.003s | |
| 🟢 | isCompressed | 0.002s | |
| 🟢 | newCompressedData | 0.002s | |
| 🟢 | newImageData | 0.002s | |
🟢 love.math
- 🟢 20 Tests
- 🔴 0 Failures
- 🟡 0 Skipped
- 0.070s
| Method | Time | Details |
| 🟢 | BezierCurve | 0.007s | |
| 🟢 | RandomGenerator | 0.002s | |
| 🟢 | Transform | 0.002s | |
| 🟢 | colorFromBytes | 0.007s | |
| 🟢 | colorToBytes | 0.002s | |
| 🟢 | gammaToLinear | 0.002s | |
| 🟢 | getRandomSeed | 0.006s | |
| 🟢 | getRandomState | 0.002s | |
| 🟢 | isConvex | 0.002s | |
| 🟢 | linearToGamma | 0.007s | |
| 🟢 | newBezierCurve | 0.002s | |
| 🟢 | newRandomGenerator | 0.002s | |
| 🟢 | newTransform | 0.006s | |
| 🟢 | perlinNoise | 0.002s | |
| 🟢 | random | 0.002s | |
| 🟢 | randomNormal | 0.006s | |
| 🟢 | setRandomSeed | 0.002s | |
| 🟢 | setRandomState | 0.002s | |
| 🟢 | simplexNoise | 0.007s | |
| 🟢 | triangulate | 0.002s | |
🟢 love.physics
- 🟢 22 Tests
- 🔴 0 Failures
- 🟡 6 Skipped
- 0.071s
| Method | Time | Details |
| 🟡 | Body | 0.002s | test class needs writing |
| 🟡 | Contact | 0.002s | test class needs writing |
| 🟡 | Fixture | 0.002s | test class needs writing |
| 🟡 | Joint | 0.002s | test class needs writing |
| 🟡 | Shape | 0.002s | test class needs writing |
| 🟡 | World | 0.002s | test class needs writing |
| 🟢 | getDistance | 0.002s | |
| 🟢 | getMeter | 0.002s | |
| 🟢 | newBody | 0.002s | |
| 🟢 | newChainShape | 0.008s | |
| 🟢 | newCircleShape | 0.002s | |
| 🟢 | newDistanceJoint | 0.002s | |
| 🟢 | newEdgeShape | 0.002s | |
| 🟢 | newFixture | 0.002s | |
| 🟢 | newFrictionJoint | 0.008s | |
| 🟢 | newGearJoint | 0.002s | |
| 🟢 | newMotorJoint | 0.002s | |
| 🟢 | newMouseJoint | 0.002s | |
| 🟢 | newPolygonShape | 0.002s | |
| 🟢 | newPrismaticJoint | 0.005s | |
| 🟢 | newPulleyJoint | 0.002s | |
| 🟢 | newRectangleShape | 0.002s | |
| 🟢 | newRevoluteJoint | 0.002s | |
| 🟢 | newRopeJoint | 0.002s | |
| 🟢 | newWeldJoint | 0.002s | |
| 🟢 | newWheelJoint | 0.002s | |
| 🟢 | newWorld | 0.002s | |
| 🟢 | setMeter | 0.002s | |
🟢 love.sound
- 🟢 4 Tests
- 🔴 0 Failures
- 🟡 0 Skipped
- 0.015s
| Method | Time | Details |
| 🟢 | Decoder | 0.006s | |
| 🟢 | SoundData | 0.003s | |
| 🟢 | newDecoder | 0.002s | |
| 🟢 | newSoundData | 0.004s | |
🟢 love.system
- 🟢 6 Tests
- 🔴 0 Failures
- 🟡 2 Skipped
- 0.026s
| Method | Time | Details |
| 🟢 | getClipboardText | 0.003s | |
| 🟢 | getOS | 0.002s | |
| 🟢 | getPowerInfo | 0.002s | |
| 🟢 | getProcessorCount | 0.002s | |
| 🟢 | hasBackgroundMusic | 0.005s | |
| 🟡 | openURL | 0.002s | cant test this worked |
| 🟢 | setClipboardText | 0.002s | |
| 🟡 | vibrate | 0.007s | cant test this worked |
🟢 love.thread
- 🟢 5 Tests
- 🔴 0 Failures
- 🟡 0 Skipped
- 0.317s
| Method | Time | Details |
| 🟢 | Channel | 0.215s | |
| 🟢 | Thread | 0.092s | |
| 🟢 | getChannel | 0.002s | |
| 🟢 | newChannel | 0.006s | |
| 🟢 | newThread | 0.002s | |
🟢 love.timer
- 🟢 6 Tests
- 🔴 0 Failures
- 🟡 0 Skipped
- 2.021s
| Method | Time | Details |
| 🟢 | getAverageDelta | 0.002s | |
| 🟢 | getDelta | 0.006s | |
| 🟢 | getFPS | 0.002s | |
| 🟢 | getTime | 1.003s | |
| 🟢 | sleep | 1.003s | |
| 🟢 | step | 0.005s | |
🟢 love.video
- 🟢 2 Tests
- 🔴 0 Failures
- 🟡 0 Skipped
- 0.012s
| Method | Time | Details |
| 🟢 | VideoStream | 0.007s | |
| 🟢 | newVideoStream | 0.005s | |
🟢 love.window
- 🟢 34 Tests
- 🔴 0 Failures
- 🟡 2 Skipped
- 5.955s
| Method | Time | Details |
| 🟢 | close | 0.034s | |
| 🟢 | fromPixels | 0.002s | |
| 🟢 | getDPIScale | 0.003s | |
| 🟢 | getDesktopDimensions | 0.002s | |
| 🟢 | getDisplayCount | 0.002s | |
| 🟢 | getDisplayName | 0.002s | |
| 🟢 | getDisplayOrientation | 0.004s | |
| 🟢 | getFullscreen | 1.365s | |
| 🟢 | getFullscreenModes | 0.014s | |
| 🟢 | getIcon | 0.019s | |
| 🟢 | getMode | 0.017s | |
| 🟢 | getPosition | 0.017s | |
| 🟢 | getSafeArea | 0.018s | |
| 🟢 | getTitle | 0.018s | |
| 🟢 | getVSync | 0.014s | |
| 🟢 | hasFocus | 0.017s | |
| 🟢 | hasMouseFocus | 0.017s | |
| 🟢 | isDisplaySleepEnabled | 0.017s | |
| 🟢 | isMaximized | 0.187s | |
| 🟢 | isMinimized | 0.735s | |
| 🟢 | isOpen | 0.040s | |
| 🟢 | isVisible | 0.034s | |
| 🟢 | maximize | 0.158s | |
| 🟢 | minimize | 0.737s | |
| 🟡 | requestAttention | 0.003s | cant test this worked |
| 🟢 | restore | 0.882s | |
| 🟢 | setDisplaySleepEnabled | 0.018s | |
| 🟢 | setFullscreen | 1.313s | |
| 🟢 | setIcon | 0.017s | |
| 🟢 | setMode | 0.022s | |
| 🟢 | setPosition | 0.179s | |
| 🟢 | setTitle | 0.021s | |
| 🟢 | setVSync | 0.017s | |
| 🟡 | showMessageBox | 0.003s | cant test this worked |
| 🟢 | toPixels | 0.002s | |
| 🟢 | updateMode | 0.007s | |
\ No newline at end of file
+🔴 love.test
- 🟢 285 Tests
- 🔴 1 Failures
- 🟡 15 Skipped
- 14.670s
🟢 love.audio
- 🟢 28 Tests
- 🔴 0 Failures
- 🟡 0 Skipped
- 0.890s
| Method | Time | Details |
| 🟢 | RecordingDevice | 0.401s | |
| 🟢 | Source | 0.022s | |
| 🟢 | getActiveEffects | 0.017s | |
| 🟢 | getActiveSourceCount | 0.019s | |
| 🟢 | getDistanceModel | 0.017s | |
| 🟢 | getDopplerScale | 0.018s | |
| 🟢 | getEffect | 0.018s | |
| 🟢 | getMaxSceneEffects | 0.019s | |
| 🟢 | getMaxSourceEffects | 0.018s | |
| 🟢 | getOrientation | 0.018s | |
| 🟢 | getPosition | 0.018s | |
| 🟢 | getRecordingDevices | 0.020s | |
| 🟢 | getVelocity | 0.017s | |
| 🟢 | getVolume | 0.018s | |
| 🟢 | isEffectsSupported | 0.018s | |
| 🟢 | newQueueableSource | 0.019s | |
| 🟢 | newSource | 0.019s | |
| 🟢 | pause | 0.020s | |
| 🟢 | play | 0.018s | |
| 🟢 | setDistanceModel | 0.016s | |
| 🟢 | setDopplerScale | 0.017s | |
| 🟢 | setEffect | 0.018s | |
| 🟢 | setMixWithSystem | 0.018s | |
| 🟢 | setOrientation | 0.017s | |
| 🟢 | setPosition | 0.017s | |
| 🟢 | setVelocity | 0.018s | |
| 🟢 | setVolume | 0.018s | |
| 🟢 | stop | 0.017s | |
🟢 love.data
- 🟢 12 Tests
- 🔴 0 Failures
- 🟡 0 Skipped
- 0.205s
| Method | Time | Details |
| 🟢 | ByteData | 0.019s | |
| 🟢 | CompressedData | 0.017s | |
| 🟢 | compress | 0.018s | |
| 🟢 | decode | 0.016s | |
| 🟢 | decompress | 0.015s | |
| 🟢 | encode | 0.016s | |
| 🟢 | getPackedSize | 0.017s | |
| 🟢 | hash | 0.016s | |
| 🟢 | newByteData | 0.017s | |
| 🟢 | newDataView | 0.018s | |
| 🟢 | pack | 0.018s | |
| 🟢 | unpack | 0.018s | |
🟢 love.event
- 🟢 4 Tests
- 🔴 0 Failures
- 🟡 2 Skipped
- 0.102s
| Method | Time | Details |
| 🟢 | clear | 0.017s | |
| 🟢 | poll | 0.017s | |
| 🟡 | pump | 0.016s | used internally |
| 🟢 | push | 0.017s | |
| 🟢 | quit | 0.017s | |
| 🟡 | wait | 0.017s | used internally |
🟢 love.filesystem
- 🟢 29 Tests
- 🔴 0 Failures
- 🟡 2 Skipped
- 0.530s
| Method | Time | Details |
| 🟢 | File | 0.020s | |
| 🟢 | FileData | 0.016s | |
| 🟢 | append | 0.018s | |
| 🟢 | areSymlinksEnabled | 0.016s | |
| 🟢 | createDirectory | 0.017s | |
| 🟢 | getAppdataDirectory | 0.016s | |
| 🟢 | getCRequirePath | 0.017s | |
| 🟢 | getDirectoryItems | 0.017s | |
| 🟢 | getIdentity | 0.017s | |
| 🟢 | getInfo | 0.018s | |
| 🟢 | getRealDirectory | 0.017s | |
| 🟢 | getRequirePath | 0.017s | |
| 🟢 | getSaveDirectory | 0.016s | |
| 🟡 | getSource | 0.018s | used internally |
| 🟢 | getSourceBaseDirectory | 0.016s | |
| 🟢 | getUserDirectory | 0.017s | |
| 🟢 | getWorkingDirectory | 0.016s | |
| 🟢 | isFused | 0.017s | |
| 🟢 | lines | 0.018s | |
| 🟢 | load | 0.017s | |
| 🟢 | mount | 0.018s | |
| 🟢 | newFileData | 0.018s | |
| 🟢 | openFile | 0.016s | |
| 🟢 | read | 0.016s | |
| 🟢 | remove | 0.019s | |
| 🟢 | setCRequirePath | 0.017s | |
| 🟢 | setIdentity | 0.017s | |
| 🟢 | setRequirePath | 0.017s | |
| 🟡 | setSource | 0.016s | used internally |
| 🟢 | unmount | 0.018s | |
| 🟢 | write | 0.017s | |
🔴 love.font
- 🟢 6 Tests
- 🔴 1 Failures
- 🟡 0 Skipped
- 0.121s
| Method | Time | Details |
| 🔴 | GlyphData | 0.018s | assert 8 [check glyph number] expected '97' got '0' |
| 🟢 | Rasterizer | 0.018s | |
| 🟢 | newBMFontRasterizer | 0.018s | |
| 🟢 | newGlyphData | 0.018s | |
| 🟢 | newImageRasterizer | 0.017s | |
| 🟢 | newRasterizer | 0.016s | |
| 🟢 | newTrueTypeRasterizer | 0.016s | |
🟢 love.graphics
- 🟢 102 Tests
- 🔴 0 Failures
- 🟡 3 Skipped
- 3.232s
| Method | Time | Details |
| 🟢 | Canvas | 0.020s | |
| 🟢 | Font | 0.024s |  Expected  Actual  Expected  Actual |
| 🟢 | Image | 0.018s |  Expected  Actual |
| 🟡 | Mesh | 0.016s | test class needs writing |
| 🟡 | ParticleSystem | 0.017s | test class needs writing |
| 🟢 | Quad | 0.019s |  Expected  Actual |
| 🟢 | Shader | 0.031s |  Expected  Actual |
| 🟢 | SpriteBatch | 0.030s |  Expected  Actual  Expected  Actual  Expected  Actual |
| 🟢 | Text | 0.024s |  Expected  Actual |
| 🟢 | Video | 1.040s |  Expected  Actual |
| 🟢 | applyTransform | 0.011s |  Expected  Actual |
| 🟢 | arc | 0.019s |  Expected  Actual  Expected  Actual  Expected  Actual |
| 🟢 | captureScreenshot | 0.184s | |
| 🟢 | circle | 0.020s |  Expected  Actual |
| 🟢 | clear | 0.022s |  Expected  Actual |
| 🟡 | discard | 0.017s | cant test this worked |
| 🟢 | draw | 0.018s |  Expected  Actual |
| 🟢 | drawInstanced | 0.030s |  Expected  Actual |
| 🟢 | drawLayer | 0.021s |  Expected  Actual |
| 🟢 | ellipse | 0.019s |  Expected  Actual |
| 🟢 | flushBatch | 0.018s | |
| 🟢 | getBackgroundColor | 0.018s | |
| 🟢 | getBlendMode | 0.017s | |
| 🟢 | getCanvas | 0.018s | |
| 🟢 | getColor | 0.018s | |
| 🟢 | getColorMask | 0.017s | |
| 🟢 | getDPIScale | 0.018s | |
| 🟢 | getDefaultFilter | 0.016s | |
| 🟢 | getDepthMode | 0.016s | |
| 🟢 | getDimensions | 0.016s | |
| 🟢 | getFont | 0.018s | |
| 🟢 | getFrontFaceWinding | 0.017s | |
| 🟢 | getHeight | 0.017s | |
| 🟢 | getLineJoin | 0.018s | |
| 🟢 | getLineStyle | 0.017s | |
| 🟢 | getLineWidth | 0.016s | |
| 🟢 | getMeshCullMode | 0.017s | |
| 🟢 | getPixelDimensions | 0.016s | |
| 🟢 | getPixelHeight | 0.018s | |
| 🟢 | getPixelWidth | 0.013s | |
| 🟢 | getPointSize | 0.018s | |
| 🟢 | getRendererInfo | 0.017s | |
| 🟢 | getScissor | 0.016s | |
| 🟢 | getShader | 0.016s | |
| 🟢 | getStackDepth | 0.017s | |
| 🟢 | getStats | 0.018s | |
| 🟢 | getStencilMode | 0.016s | |
| 🟢 | getSupported | 0.018s | |
| 🟢 | getSystemLimits | 0.017s | |
| 🟢 | getTextureFormats | 0.017s | |
| 🟢 | getTextureTypes | 0.017s | |
| 🟢 | getWidth | 0.016s | |
| 🟢 | intersectScissor | 0.018s |  Expected  Actual |
| 🟢 | inverseTransformPoint | 0.016s | |
| 🟢 | isActive | 0.018s | |
| 🟢 | isGammaCorrect | 0.016s | |
| 🟢 | isWireframe | 0.017s | |
| 🟢 | line | 0.019s |  Expected  Actual |
| 🟢 | newArrayImage | 0.016s | |
| 🟢 | newCanvas | 0.016s | |
| 🟢 | newCubeImage | 0.018s | |
| 🟢 | newFont | 0.016s | |
| 🟢 | newImage | 0.016s | |
| 🟢 | newImageFont | 0.016s | |
| 🟢 | newMesh | 0.016s | |
| 🟢 | newParticleSystem | 0.018s | |
| 🟢 | newQuad | 0.020s | |
| 🟢 | newShader | 0.024s | |
| 🟢 | newSpriteBatch | 0.017s | |
| 🟢 | newTextBatch | 0.019s | |
| 🟢 | newVideo | 0.021s | |
| 🟢 | newVolumeImage | 0.018s | |
| 🟢 | origin | 0.019s |  Expected  Actual |
| 🟢 | points | 0.022s |  Expected  Actual |
| 🟢 | polygon | 0.018s |  Expected  Actual |
| 🟢 | pop | 0.032s |  Expected  Actual |
| 🟢 | print | 0.019s |  Expected  Actual |
| 🟢 | printf | 0.018s |  Expected  Actual |
| 🟢 | push | 0.018s |  Expected  Actual |
| 🟢 | rectangle | 0.032s |  Expected  Actual  Expected  Actual |
| 🟢 | replaceTransform | 0.024s |  Expected  Actual |
| 🟢 | reset | 0.016s | |
| 🟢 | rotate | 0.036s |  Expected  Actual |
| 🟢 | scale | 0.014s | |
| 🟢 | setBackgroundColor | 0.018s | |
| 🟢 | setBlendMode | 0.027s |  Expected  Actual |
| 🟢 | setCanvas | 0.018s |  Expected  Actual |
| 🟢 | setColor | 0.018s |  Expected  Actual |
| 🟢 | setColorMask | 0.023s |  Expected  Actual |
| 🟢 | setDefaultFilter | 0.016s | |
| 🟢 | setDepthMode | 0.016s | |
| 🟢 | setFont | 0.030s |  Expected  Actual |
| 🟢 | setFrontFaceWinding | 0.018s | |
| 🟢 | setLineJoin | 0.019s |  Expected  Actual |
| 🟢 | setLineStyle | 0.029s |  Expected  Actual |
| 🟢 | setLineWidth | 0.021s |  Expected  Actual |
| 🟢 | setMeshCullMode | 0.016s | |
| 🟢 | setScissor | 0.034s |  Expected  Actual |
| 🟢 | setShader | 0.023s |  Expected  Actual |
| 🟢 | setStencilMode | 0.019s |  Expected  Actual |
| 🟢 | setWireframe | 0.030s |  Expected  Actual |
| 🟢 | shear | 0.022s |  Expected  Actual  Expected  Actual |
| 🟢 | transformPoint | 0.016s | |
| 🟢 | translate | 0.031s |  Expected  Actual |
| 🟢 | validateShader | 0.019s | |
🟢 love.image
- 🟢 5 Tests
- 🔴 0 Failures
- 🟡 0 Skipped
- 0.086s
| Method | Time | Details |
| 🟢 | CompressedImageData | 0.017s | |
| 🟢 | ImageData | 0.018s | |
| 🟢 | isCompressed | 0.017s | |
| 🟢 | newCompressedData | 0.018s | |
| 🟢 | newImageData | 0.018s | |
🟢 love.math
- 🟢 20 Tests
- 🔴 0 Failures
- 🟡 0 Skipped
- 0.339s
| Method | Time | Details |
| 🟢 | BezierCurve | 0.017s | |
| 🟢 | RandomGenerator | 0.017s | |
| 🟢 | Transform | 0.018s | |
| 🟢 | colorFromBytes | 0.018s | |
| 🟢 | colorToBytes | 0.018s | |
| 🟢 | gammaToLinear | 0.017s | |
| 🟢 | getRandomSeed | 0.016s | |
| 🟢 | getRandomState | 0.016s | |
| 🟢 | isConvex | 0.017s | |
| 🟢 | linearToGamma | 0.016s | |
| 🟢 | newBezierCurve | 0.016s | |
| 🟢 | newRandomGenerator | 0.016s | |
| 🟢 | newTransform | 0.017s | |
| 🟢 | perlinNoise | 0.017s | |
| 🟢 | random | 0.017s | |
| 🟢 | randomNormal | 0.018s | |
| 🟢 | setRandomSeed | 0.016s | |
| 🟢 | setRandomState | 0.016s | |
| 🟢 | simplexNoise | 0.016s | |
| 🟢 | triangulate | 0.017s | |
🟢 love.physics
- 🟢 22 Tests
- 🔴 0 Failures
- 🟡 4 Skipped
- 0.434s
| Method | Time | Details |
| 🟡 | Body | 0.017s | test class needs writing |
| 🟡 | Contact | 0.017s | test class needs writing |
| 🟡 | Joint | 0.017s | test class needs writing |
| 🟡 | Shape | 0.016s | test class needs writing |
| 🟢 | World | 0.016s | |
| 🟢 | getDistance | 0.016s | |
| 🟢 | getMeter | 0.017s | |
| 🟢 | newBody | 0.016s | |
| 🟢 | newChainShape | 0.018s | |
| 🟢 | newCircleShape | 0.016s | |
| 🟢 | newDistanceJoint | 0.018s | |
| 🟢 | newEdgeShape | 0.018s | |
| 🟢 | newFrictionJoint | 0.016s | |
| 🟢 | newGearJoint | 0.016s | |
| 🟢 | newMotorJoint | 0.015s | |
| 🟢 | newMouseJoint | 0.017s | |
| 🟢 | newPolygonShape | 0.018s | |
| 🟢 | newPrismaticJoint | 0.016s | |
| 🟢 | newPulleyJoint | 0.016s | |
| 🟢 | newRectangleShape | 0.017s | |
| 🟢 | newRevoluteJoint | 0.016s | |
| 🟢 | newRopeJoint | 0.018s | |
| 🟢 | newWeldJoint | 0.018s | |
| 🟢 | newWheelJoint | 0.016s | |
| 🟢 | newWorld | 0.016s | |
| 🟢 | setMeter | 0.016s | |
🟢 love.sound
- 🟢 4 Tests
- 🔴 0 Failures
- 🟡 0 Skipped
- 0.071s
| Method | Time | Details |
| 🟢 | Decoder | 0.018s | |
| 🟢 | SoundData | 0.018s | |
| 🟢 | newDecoder | 0.017s | |
| 🟢 | newSoundData | 0.018s | |
🟢 love.system
- 🟢 6 Tests
- 🔴 0 Failures
- 🟡 2 Skipped
- 0.139s
| Method | Time | Details |
| 🟢 | getClipboardText | 0.017s | |
| 🟢 | getOS | 0.018s | |
| 🟢 | getPowerInfo | 0.017s | |
| 🟢 | getProcessorCount | 0.018s | |
| 🟢 | hasBackgroundMusic | 0.017s | |
| 🟡 | openURL | 0.016s | cant test this worked |
| 🟢 | setClipboardText | 0.017s | |
| 🟡 | vibrate | 0.017s | cant test this worked |
🟢 love.thread
- 🟢 5 Tests
- 🔴 0 Failures
- 🟡 0 Skipped
- 0.376s
| Method | Time | Details |
| 🟢 | Channel | 0.235s | |
| 🟢 | Thread | 0.091s | |
| 🟢 | getChannel | 0.018s | |
| 🟢 | newChannel | 0.015s | |
| 🟢 | newThread | 0.016s | |
🟢 love.timer
- 🟢 6 Tests
- 🔴 0 Failures
- 🟡 0 Skipped
- 2.091s
| Method | Time | Details |
| 🟢 | getAverageDelta | 0.017s | |
| 🟢 | getDelta | 0.017s | |
| 🟢 | getFPS | 0.016s | |
| 🟢 | getTime | 1.017s | |
| 🟢 | sleep | 1.012s | |
| 🟢 | step | 0.012s | |
🟢 love.video
- 🟢 2 Tests
- 🔴 0 Failures
- 🟡 0 Skipped
- 0.039s
| Method | Time | Details |
| 🟢 | VideoStream | 0.019s | |
| 🟢 | newVideoStream | 0.020s | |
🟢 love.window
- 🟢 34 Tests
- 🔴 0 Failures
- 🟡 2 Skipped
- 6.015s
| Method | Time | Details |
| 🟢 | close | 0.048s | |
| 🟢 | fromPixels | 0.002s | |
| 🟢 | getDPIScale | 0.002s | |
| 🟢 | getDesktopDimensions | 0.017s | |
| 🟢 | getDisplayCount | 0.017s | |
| 🟢 | getDisplayName | 0.016s | |
| 🟢 | getDisplayOrientation | 0.017s | |
| 🟢 | getFullscreen | 1.345s | |
| 🟢 | getFullscreenModes | 0.012s | |
| 🟢 | getIcon | 0.019s | |
| 🟢 | getMode | 0.016s | |
| 🟢 | getPosition | 0.017s | |
| 🟢 | getSafeArea | 0.016s | |
| 🟢 | getTitle | 0.017s | |
| 🟢 | getVSync | 0.015s | |
| 🟢 | hasFocus | 0.017s | |
| 🟢 | hasMouseFocus | 0.017s | |
| 🟢 | isDisplaySleepEnabled | 0.016s | |
| 🟢 | isMaximized | 0.185s | |
| 🟢 | isMinimized | 0.730s | |
| 🟢 | isOpen | 0.041s | |
| 🟢 | isVisible | 0.029s | |
| 🟢 | maximize | 0.156s | |
| 🟢 | minimize | 0.731s | |
| 🟡 | requestAttention | 0.011s | cant test this worked |
| 🟢 | restore | 0.883s | |
| 🟢 | setDisplaySleepEnabled | 0.018s | |
| 🟢 | setFullscreen | 1.339s | |
| 🟢 | setIcon | 0.016s | |
| 🟢 | setMode | 0.022s | |
| 🟢 | setPosition | 0.179s | |
| 🟢 | setTitle | 0.018s | |
| 🟢 | setVSync | 0.016s | |
| 🟡 | showMessageBox | 0.002s | cant test this worked |
| 🟢 | toPixels | 0.002s | |
| 🟢 | updateMode | 0.011s | |
\ No newline at end of file
diff --git a/testing/examples/lovetest_runAllTests.md b/testing/examples/lovetest_runAllTests.md
index fae747d8a..0c75c10f7 100644
--- a/testing/examples/lovetest_runAllTests.md
+++ b/testing/examples/lovetest_runAllTests.md
@@ -1,28 +1,28 @@
-
+
### Info
-**303** tests were completed in **9.881s** with **282** passed, **1** failed, and **20** skipped
+**301** tests were completed in **14.670s** with **285** passed, **1** failed, and **15** skipped
Renderer: OpenGL | 4.1 Metal - 76.3 | Apple | Apple M1 Max
### Report
| Module | Pass | Fail | Skip | Time |
| --------------------- | ------ | ------ | ------- | ------ |
-| 🟢 audio | 28 | 0 | 0 | 0.857s |
-| 🟢 data | 12 | 0 | 0 | 0.139s |
-| 🟢 event | 4 | 0 | 2 | 0.010s |
-| 🟢 filesystem | 29 | 0 | 2 | 0.068s |
-| 🔴 font | 6 | 1 | 0 | 0.015s |
-| 🟢 graphics | 99 | 0 | 6 | 0.294s |
-| 🟢 image | 5 | 0 | 0 | 0.011s |
-| 🟢 math | 20 | 0 | 0 | 0.070s |
-| 🟢 physics | 22 | 0 | 6 | 0.071s |
-| 🟢 sound | 4 | 0 | 0 | 0.015s |
-| 🟢 system | 6 | 0 | 2 | 0.026s |
-| 🟢 thread | 5 | 0 | 0 | 0.317s |
-| 🟢 timer | 6 | 0 | 0 | 2.021s |
-| 🟢 video | 2 | 0 | 0 | 0.012s |
-| 🟢 window | 34 | 0 | 2 | 5.955s |
+| 🟢 audio | 28 | 0 | 0 | 0.890s |
+| 🟢 data | 12 | 0 | 0 | 0.205s |
+| 🟢 event | 4 | 0 | 2 | 0.102s |
+| 🟢 filesystem | 29 | 0 | 2 | 0.530s |
+| 🔴 font | 6 | 1 | 0 | 0.121s |
+| 🟢 graphics | 102 | 0 | 3 | 3.232s |
+| 🟢 image | 5 | 0 | 0 | 0.086s |
+| 🟢 math | 20 | 0 | 0 | 0.339s |
+| 🟢 physics | 22 | 0 | 4 | 0.434s |
+| 🟢 sound | 4 | 0 | 0 | 0.071s |
+| 🟢 system | 6 | 0 | 2 | 0.139s |
+| 🟢 thread | 5 | 0 | 0 | 0.376s |
+| 🟢 timer | 6 | 0 | 0 | 2.091s |
+| 🟢 video | 2 | 0 | 0 | 0.039s |
+| 🟢 window | 34 | 0 | 2 | 6.015s |
### Failures
> 🔴 GlyphData
diff --git a/testing/examples/lovetest_runAllTests.xml b/testing/examples/lovetest_runAllTests.xml
index a2c161469..0ae096f1c 100644
--- a/testing/examples/lovetest_runAllTests.xml
+++ b/testing/examples/lovetest_runAllTests.xml
@@ -1,659 +1,650 @@
-
-
-
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
+
+
-
+
-
+
-
+
-
+
-
+
-
-
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
+
+
assert 8 [check glyph number] expected '97' got '0'
-
+
-
+
-
+
-
+
-
+
-
+
-
-
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
+
-
+
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
+
+
-
+
-
+
-
+
-
+
-
-
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
+
+
-
+
-
+
-
+
-
-
+
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
+
-
-
+
+
-
+
-
+
-
+
-
-
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
+
+
-
+
-
+
-
+
-
+
-
-
+
+
-
+
-
+
-
+
-
+
-
+
-
-
+
+
-
+
-
-
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
\ No newline at end of file
diff --git a/testing/output/expected/love.test.graphics.SpriteBatch-1.png b/testing/output/expected/love.test.graphics.SpriteBatch-1.png
new file mode 100644
index 0000000000000000000000000000000000000000..e3c032481bcaa1955602e861480520f2ee099a22
GIT binary patch
literal 96
zcmeAS@N?(olHy`uVBq!ia0vp^4j|0P3?wHke>@jRu?6^qxLymJevN^l{=gefpopla
si(^Q|oaBUt#{U5a477~2oVIWFVdQ&MBb@08d969smFU
literal 0
HcmV?d00001
diff --git a/testing/output/expected/love.test.graphics.SpriteBatch-2.png b/testing/output/expected/love.test.graphics.SpriteBatch-2.png
new file mode 100644
index 0000000000000000000000000000000000000000..3427e61411b34b4431b6bd97251a6448f0a4b0ed
GIT binary patch
literal 111
zcmeAS@N?(olHy`uVBq!ia0vp^4j|0L3?#3!&-4XSJOMr-u0Z<#|Nqy*re9-V5UNo+
z3*^grx;TbZ%t=mgU|*P#5R%}+y~c@|=l{h6E4n7GVPYs=;Cue|MdwLCl?wE6^fu6{1-oD!M
zo-U3d6?4{JGURG-;BmRAG9m4EjMDd$s#KD|l{z3l1Ur|{fx9Lw)YHcUX3Fy-?%?J!yIz{*X!K&TG2b5S2vdr4R;b_pP
jrsE{wvw+jF;vAo{mc->FbJjlqI)}m2)z4*}Q$iB}CHqEG
literal 0
HcmV?d00001
diff --git a/testing/output/expected/love.test.graphics.Video-1.png b/testing/output/expected/love.test.graphics.Video-1.png
new file mode 100644
index 0000000000000000000000000000000000000000..ad8b44e9e9ca1382b903d4eca4d7b098d5f1a5c9
GIT binary patch
literal 197
zcmeAS@N?(olHy`uVBq!ia0y~yVEh8YjLblhj}pEoffQSSPlzj!{?EW5{l8ZU$g1*m
zaSW-L^Y*kNBLf2ulfkd$wJq%j6wLN7DT@7Gd!J^g{-wQl;gt&^f2Pg@x`M&e)z4*}
HQ$iB}yGmx!
literal 0
HcmV?d00001
diff --git a/testing/output/expected/love.test.graphics.drawInstanced-1.png b/testing/output/expected/love.test.graphics.drawInstanced-1.png
new file mode 100644
index 0000000000000000000000000000000000000000..8211034e0e3be567173b2deea7fba38178e1b0d1
GIT binary patch
literal 369
zcmV-%0gnEOP)0003vNklkT_BcE=3TrcG9?f#w<`U!
z8h!z=G`s@vGyDT!W>^E@WY_>;W7r1ZVR#F`z_15E-OvC)+Rz3-*U$_=)X)P!(a;G%
z&d?7)%P<5$$S?{(#c%+Cgy9%~dc$D=#fAs~m4+YyWrjEaHHJ_C1%_wh_!
zgc<4p#288e1Q@CT95o04IAqWOFm8|mFlbN$Fk%n`&~4BI&}WbY&|y#o&}t9{&}7gC
zuy2qDuw!rl@XlZYVAJ3OVBKH^V8!4D;IF|Dz>C2Xz>mQez?Z=pz+(6WY&U@SQ}gxp
P00000NkvXXu0mjfBh-=&
literal 0
HcmV?d00001
diff --git a/testing/output/expected/love.test.graphics.setStencilTest-1.png b/testing/output/expected/love.test.graphics.setStencilMode-1.png
similarity index 100%
rename from testing/output/expected/love.test.graphics.setStencilTest-1.png
rename to testing/output/expected/love.test.graphics.setStencilMode-1.png
diff --git a/testing/readme.md b/testing/readme.md
index c0eab1201..a6bace051 100644
--- a/testing/readme.md
+++ b/testing/readme.md
@@ -26,10 +26,10 @@ This is the status of all module tests currently.
| 🟢 event | 4 | 0 | 2 |
| 🟢 filesystem | 29 | 0 | 2 |
| 🟢 font | 7 | 0 | 0 |
-| 🟡 graphics | 99 | 5 | 1 |
+| 🟡 graphics | 102 | 2 | 1 |
| 🟢 image | 5 | 0 | 0 |
| 🟢 math | 20 | 0 | 0 |
-| 🟡 physics | 22 | 6 | 0 |
+| 🟡 physics | 22 | 4 | 0 |
| 🟢 sound | 4 | 0 | 0 |
| 🟢 system | 6 | 0 | 2 |
| 🟢 thread | 5 | 0 | 0 |
@@ -60,7 +60,7 @@ All results will be printed in the console per method as PASS, FAIL, or SKIP wit
When finished, the following files will be generated in the `/output` directory with a summary of the test results:
- an `XML` file in the style of [JUnit XML](https://www.ibm.com/docs/en/developer-for-zos/14.1?topic=formats-junit-xml-format)
-- a `HTML` file that shows any visual test results
+- a `HTML` file that shows the report + any visual test results
- a `Markdown` file you can use with [this github action](https://github.com/ellraiser/love-test-report)
> An example of all types of output can be found in the `/examples`
> The visual results of any graphic tests can be found in `/output/actual`
@@ -110,15 +110,13 @@ For sanity-checking, if it's currently not covered or it's not possible to test
---
## Todo
-Things still left to do:
-- [ ] physics.Body, physics.Contact, physics.Fixture,
- physics.Joint, physics.Shape, physics.World
-- [ ] @deprecated physics methods (sasha changes)
-- [ ] graphics.Mesh, graphics.ParticleSystem
- graphics.SpriteBatch, graphics.Video
-- [ ] graphics.drawInstanced
-- [ ] @deprecated love.graphics.stencil (replaced by love.graphics.setStencilMode)
-- [ ] @deprecated love.graphics.setStencilTest (replaced by love.graphics.setStencilMode)
+Test classes that still need to be written:
+- [ ] graphics.Mesh
+- [ ] graphics.ParticleSystem
+- [ ] physics.Body
+- [ ] physics.Contact
+- [ ] physics.Joint
+- [ ] physics.Shape
---
@@ -129,4 +127,4 @@ Things still left to do:
use in the report output comparisons, so we just need to add a helper method
to the test class to let you just do assertMatching on the imgdata
- [ ] Ability to test loading different combinations of modules
-- [ ] Performance tests
+- [ ] Performance tests
\ No newline at end of file
diff --git a/testing/tests/graphics.lua b/testing/tests/graphics.lua
index 3c0544943..74efb796b 100644
--- a/testing/tests/graphics.lua
+++ b/testing/tests/graphics.lua
@@ -60,10 +60,11 @@ love.test.graphics.Canvas = function(test)
test:assertEquals('linear', mode, 'check def minmap filter mode')
test:assertEquals(0, sharpness, 'check def minmap filter sharpness')
local name, version, vendor, device = love.graphics.getRendererInfo()
+ canvas:setMipmapFilter('nearest', 1)
+ mode, sharpness = canvas:getMipmapFilter()
+ test:assertEquals('nearest', mode, 'check changed minmap filter mode')
+ -- mipmap sharpness wont work on opengl/metal
if string.match(name, 'OpenGL ES') == nil and string.match(name, 'Metal') == nil then
- canvas:setMipmapFilter('nearest', 1)
- mode, sharpness = canvas:getMipmapFilter()
- test:assertEquals('nearest', mode, 'check changed minmap filter mode')
test:assertEquals(1, sharpness, 'check changed minmap filter sharpness')
end
test:assertGreaterEqual(2, canvas:getMipmapCount()) -- docs say no mipmaps should return 1
@@ -209,10 +210,11 @@ love.test.graphics.Image = function(test)
test:assertEquals(0, sharpness, 'check def minmap filter sharpness')
local name, version, vendor, device = love.graphics.getRendererInfo()
+ -- mipmap sharpness wont work on opengl/metal
+ image:setMipmapFilter('nearest', 1)
+ mode, sharpness = image:getMipmapFilter()
+ test:assertEquals('nearest', mode, 'check changed minmap filter mode')
if string.match(name, 'OpenGL ES') == nil and string.match(name, 'Metal') == nil then
- image:setMipmapFilter('nearest', 1)
- mode, sharpness = image:getMipmapFilter()
- test:assertEquals('nearest', mode, 'check changed minmap filter mode')
test:assertEquals(1, sharpness, 'check changed minmap filter sharpness')
end
test:assertGreaterEqual(2, image:getMipmapCount()) -- docs say no mipmaps should return 1
@@ -351,7 +353,133 @@ end
-- SpriteBatch (love.graphics.newSpriteBatch)
love.test.graphics.SpriteBatch = function(test)
- test:skipTest('test class needs writing')
+ -- create batch
+ local texture1 = love.graphics.newImage('resources/cubemap.png')
+ local texture2 = love.graphics.newImage('resources/love.png')
+ local quad1 = love.graphics.newQuad(32, 12, 1, 1, texture2) -- lovepink
+ local quad2 = love.graphics.newQuad(32, 32, 1, 1, texture2) -- white
+ local sbatch = love.graphics.newSpriteBatch(texture1, 5000)
+ test:assertObject(sbatch)
+ -- check basic props
+ test:assertEquals(0, sbatch:getCount(), 'check batch size')
+ test:assertEquals(5000, sbatch:getBufferSize(), 'check batch size')
+ test:assertEquals(texture1:getWidth(), sbatch:getTexture():getWidth(), 'check texture match w')
+ test:assertEquals(texture1:getHeight(), sbatch:getTexture():getHeight(), 'check texture match h')
+ sbatch:setTexture(texture2)
+ test:assertEquals(texture2:getWidth(), sbatch:getTexture():getWidth(), 'check texture change w')
+ test:assertEquals(texture2:getHeight(), sbatch:getTexture():getHeight(), 'check texture change h')
+ local r, g, b, a = sbatch:getColor()
+ test:assertEquals(1, r, 'check initial color r')
+ test:assertEquals(1, g, 'check initial color g')
+ test:assertEquals(1, b, 'check initial color b')
+ test:assertEquals(1, a, 'check initial color a')
+ sbatch:setColor(1, 0, 0, 1)
+ r, g, b, a = sbatch:getColor()
+ test:assertEquals(1, r, 'check set color r')
+ test:assertEquals(0, g, 'check set color g')
+ test:assertEquals(0, b, 'check set color b')
+ test:assertEquals(1, a, 'check set color a')
+ -- check adding sprites
+ local offset_x = 0
+ local offset_y = 0
+ local color = 'white'
+ sbatch:setColor(1, 1, 1, 1)
+ local sprites = {}
+ for s=1,4096 do
+ local spr = sbatch:add(quad1, offset_x, offset_y, 0, 1, 1)
+ table.insert(sprites, {spr, offset_x, offset_y})
+ offset_x = offset_x + 1
+ if s % 64 == 0 then
+ -- alternate row colors
+ if color == 'white' then
+ color = 'red'
+ sbatch:setColor(1, 0, 0, 1)
+ else
+ color = 'white'
+ sbatch:setColor(1, 1, 1, 1)
+ end
+ offset_y = offset_y + 1
+ offset_x = 0
+ end
+ end
+ test:assertEquals(4096, sbatch:getCount())
+ -- test drawing and setting
+ local canvas = love.graphics.newCanvas(64, 64)
+ love.graphics.setCanvas(canvas)
+ love.graphics.clear(0, 0, 0, 1)
+ love.graphics.draw(sbatch, 0, 0)
+ love.graphics.setCanvas()
+ local imgdata1 = love.graphics.readbackTexture(canvas, {64, 0, 0, 0, 64, 64})
+ test:assertPixels(imgdata1, {
+ lovepink = {{0,0},{63,2},{0,32},{63,32},{63,0},{63,2}}
+ }, 'sbatch draw normal')
+ test:exportImg(imgdata1)
+ -- use set to change some sprites
+ for s=1,2048 do
+ sbatch:set(sprites[s][1], quad2, sprites[s][2], sprites[s][3]+1, 0, 1, 1)
+ end
+ love.graphics.setCanvas(canvas)
+ love.graphics.clear(0, 0, 0, 1)
+ love.graphics.draw(sbatch, 0, 0)
+ love.graphics.setCanvas()
+ local imgdata2 = love.graphics.readbackTexture(canvas, {64, 0, 0, 0, 64, 64})
+ test:assertPixels(imgdata2, {
+ lovepink = {{0,32},{63,32}},
+ black = {{0,0},{63,0}},
+ white = {{0,1},{63,1},{0,31},{63,31}}
+ }, 'sbatch draw set')
+ test:exportImg(imgdata2)
+ -- set drawRange and redraw
+ sbatch:setDrawRange(1025, 2048)
+ love.graphics.setCanvas(canvas)
+ love.graphics.clear(0, 0, 0, 1)
+ love.graphics.draw(sbatch, 0, 0)
+ love.graphics.setCanvas()
+ local imgdata3 = love.graphics.readbackTexture(canvas, {64, 0, 0, 0, 64, 64})
+ test:assertPixels(imgdata3, {
+ lovepink = {{0,32},{63,32}},
+ black = {{0,0},{63,0},{0,48},{63,48}},
+ white = {{0,17},{63,17},{0,31},{63,31}}
+ }, 'sbatch draw drawrange')
+ test:exportImg(imgdata3)
+ -- clear and redraw
+ sbatch:clear()
+ love.graphics.setCanvas(canvas)
+ love.graphics.clear(0, 0, 0, 1)
+ love.graphics.draw(sbatch, 0, 0)
+ love.graphics.setCanvas()
+ local imgdata4 = love.graphics.readbackTexture(canvas, {64, 0, 0, 0, 64, 64})
+ test:assertPixels(imgdata4, {
+ black = {{0,0},{63,0},{0,32},{63,32},{0,63},{63,63}},
+ }, 'sbatch draw clear')
+ test:exportImg(imgdata4)
+ -- array texture sbatch
+ local texture3 = love.graphics.newArrayImage({
+ 'resources/love.png',
+ 'resources/loveinv.png'
+ })
+ local asbatch = love.graphics.newSpriteBatch(texture3, 4096)
+ local quad3 = love.graphics.newQuad(32, 52, 1, 1, texture3) -- loveblue
+ sprites = {}
+ for s=1,4096 do
+ local spr = asbatch:addLayer(1, quad3, 0, s, math.floor(s/64), 1, 1)
+ table.insert(sprites, {spr, s, math.floor(s/64)})
+ end
+ test:assertEquals(4096, asbatch:getCount(), 'check max batch size applies')
+ for s=1,2048 do
+ asbatch:setLayer(sprites[s][1], 2, sprites[s][2], sprites[s][3], 0, 1, 1)
+ end
+ love.graphics.setCanvas(canvas)
+ love.graphics.clear(0, 0, 0, 1)
+ love.graphics.draw(asbatch, 0, 0)
+ love.graphics.setCanvas()
+ local imgdata5 = love.graphics.readbackTexture(canvas, {64, 0, 0, 0, 64, 64})
+ test:assertPixels(imgdata5, {
+ loveblue = {{31,2},{63,2},{3,30},{3,33},{16,47},{63,47}},
+ lovepink = {{17,48},{63,48},{31,61},{63,61}},
+ black = {{0,0},{63,0},{63,63},{63,0},{30,2},{30,61}},
+ }, 'sbatch draw layers')
+ test:exportImg(imgdata5)
end
@@ -396,7 +524,54 @@ end
-- Video (love.graphics.newVideo)
love.test.graphics.Video = function(test)
- test:skipTest('test class needs writing')
+ -- create video
+ local video = love.graphics.newVideo('resources/sample.ogv')
+ test:assertObject(video)
+ -- check basic props
+ local w, h = video:getDimensions()
+ test:assertEquals(496, w, 'check vid dim w')
+ test:assertEquals(502, h, 'check vid dim h')
+ test:assertEquals(w, video:getWidth(), 'check vid width match')
+ test:assertEquals(h, video:getHeight(), 'check vid height match')
+ local min, mag, ani = video:getFilter()
+ test:assertEquals('nearest', min, 'check def filter min')
+ test:assertEquals('nearest', mag, 'check def filter mag')
+ test:assertEquals(1, ani, 'check def filter ani')
+ video:setFilter('linear', 'linear', 2)
+ min, mag, ani = video:getFilter()
+ test:assertEquals('linear', min, 'check changed filter min')
+ test:assertEquals('linear', mag, 'check changed filter mag')
+ test:assertEquals(2, ani, 'check changed filter ani')
+ test:assertEquals(false, video:isPlaying(), 'check paused by default')
+ test:assertEquals(0, video:tell(), 'check 0:00 by default')
+ -- covered by their own obj tests in video but check returns obj
+ local source = video:getSource()
+ test:assertObject(source)
+ local stream = video:getStream()
+ test:assertObject(stream)
+ -- check playing / pausing / seeking
+ video:play()
+ test:waitFrames(60)
+ video:pause()
+ test:assertEquals(1, math.ceil(video:tell()), 'check video playing for 1s')
+ video:seek(0.2)
+ test:assertEquals(0.2, video:tell(), 'check video seeking')
+ video:rewind()
+ test:assertEquals(0, video:tell(), 'check video rewind')
+ video:setFilter('nearest', 'nearest', 1)
+ video:play()
+ -- check actuall drawing with the vid
+ local canvas = love.graphics.newCanvas(500, 500)
+ love.graphics.setCanvas(canvas)
+ love.graphics.clear(1, 0, 0, 1)
+ love.graphics.draw(video, 0, 0)
+ love.graphics.setCanvas()
+ local imgdata = love.graphics.readbackTexture(canvas, {500, 0, 0, 0, 500, 500})
+ test:assertPixels(imgdata, {
+ black = {{0,0},{495,0},{495,499},{0,499}},
+ red = {{499,0},{499,499}}
+ }, 'video draw')
+ test:exportImg(imgdata)
end
@@ -560,7 +735,27 @@ end
-- love.graphics.drawInstanced
love.test.graphics.drawInstanced = function(test)
- test:skipTest('test class needs writing')
+ local image = love.graphics.newImage('resources/love.png')
+ local vertices = {
+ { 0, 0, 0, 0, 1, 0, 0 },
+ { image:getWidth(), 0, 1, 0, 0, 1, 0 },
+ { image:getWidth(), image:getHeight(), 1, 1, 0, 0, 1 },
+ { 0, image:getHeight(), 0, 1, 1, 1, 0 },
+ }
+ local mesh = love.graphics.newMesh(vertices, 'fan')
+ local canvas = love.graphics.newCanvas(64, 64)
+ love.graphics.setCanvas(canvas)
+ love.graphics.clear(0, 0, 0, 1)
+ love.graphics.drawInstanced(mesh, 1000, 0, 0, 0, 1, 1)
+ love.graphics.setCanvas()
+ local imgdata = love.graphics.readbackTexture(canvas, {64, 0, 0, 0, 64, 64})
+ test:assertPixels(imgdata, {
+ red = {{0,0}},
+ green = {{63,0}},
+ blue = {{63,63}},
+ yellow = {{0,63}}
+ }, 'draw instances')
+ test:exportImg(imgdata)
end
@@ -1648,19 +1843,18 @@ love.test.graphics.setShader = function(test)
end
--- love.graphics.setStencilTest
-love.test.graphics.setStencilTest = function(test)
+-- love.graphics.setStencilMode
+love.test.graphics.setStencilMode = function(test)
local canvas = love.graphics.newCanvas(16, 16)
love.graphics.setCanvas({canvas, stencil=true})
love.graphics.clear(0, 0, 0, 1)
- love.graphics.stencil(function()
- love.graphics.circle('fill', 8, 8, 6)
- end, 'replace', 1)
- love.graphics.setStencilTest('greater', 0)
+ love.graphics.setStencilMode('replace', 'always', 1)
+ love.graphics.circle('fill', 8, 8, 6)
+ love.graphics.setStencilMode('keep', 'greater', 0)
love.graphics.setColor(1, 0, 0, 1)
love.graphics.rectangle('fill', 0, 0, 16, 16)
love.graphics.setColor(1, 1, 1, 1)
- love.graphics.setStencilTest()
+ love.graphics.setStencilMode()
love.graphics.setCanvas()
local imgdata = love.graphics.readbackTexture(canvas, {16, 0, 0, 0, 16, 16})
test:assertPixels(imgdata, {
diff --git a/testing/tests/physics.lua b/testing/tests/physics.lua
index 929bbf0e6..a10f53bb7 100644
--- a/testing/tests/physics.lua
+++ b/testing/tests/physics.lua
@@ -20,12 +20,6 @@ love.test.physics.Contact = function(test)
end
--- Fixture (love.physics.newFixture)
-love.test.physics.Fixture = function(test)
- test:skipTest('test class needs writing')
-end
-
-
-- Joint (love.physics.newDistanceJoint)
love.test.physics.Joint = function(test)
test:skipTest('test class needs writing')
@@ -33,6 +27,7 @@ end
-- Shape (love.physics.newCircleShape)
+-- @NOTE includes Fixture methods too enjoy
love.test.physics.Shape = function(test)
test:skipTest('test class needs writing')
end
@@ -40,7 +35,81 @@ end
-- World (love.physics.newWorld)
love.test.physics.World = function(test)
- test:skipTest('test class needs writing')
+ -- create new world
+ local world = love.physics.newWorld(0, 0, false)
+ local body1 = love.physics.newBody(world, 0, 0, 'dynamic')
+ local rectangle1 = love.physics.newRectangleShape(body1, 0, 0, 10, 10)
+ test:assertObject(world)
+ -- check defaults
+ test:assertEquals(1, #world:getBodies(), 'check 1 body')
+ test:assertEquals(0, world:getBodies()[1]:getX(), 'check body prop x')
+ test:assertEquals(0, world:getBodies()[1]:getY(), 'check body prop y')
+ world:translateOrigin(-10, -10)
+ test:assertEquals(10, world:getBodies()[1]:getX(), 'check body prop change x')
+ test:assertEquals(10, world:getBodies()[1]:getY(), 'check body prop change y')
+ test:assertEquals(1, world:getBodyCount(), 'check 1 body count')
+ test:assertEquals(false, world:isDestroyed(), 'check not destroyed')
+ test:assertEquals(false, world:isLocked(), 'check not updating')
+ test:assertEquals(0, #world:getJoints(), 'check no joints')
+ test:assertEquals(0, world:getJointCount(), 'check no joints count')
+ test:assertEquals(0, world:getGravity(), 'check def gravity')
+ test:assertEquals(0, #world:getContacts(), 'check no contacts')
+ test:assertEquals(0, world:getContactCount(), 'check no contact count')
+ test:assertEquals(false, world:isSleepingAllowed(), 'check no sleep (till brooklyn)')
+ world:setSleepingAllowed(true)
+ test:assertEquals(true, world:isSleepingAllowed(), 'check can sleep')
+ -- check callbacks are called
+ local beginContact, endContact, preSolve, postSolve = world:getCallbacks()
+ test:assertEquals(nil, beginContact, 'check no begin contact callback')
+ test:assertEquals(nil, endContact, 'check no end contact callback')
+ test:assertEquals(nil, preSolve, 'check no pre solve callback')
+ test:assertEquals(nil, postSolve, 'check no post solve callback')
+ local beginContactCheck = false
+ local endContactCheck = false
+ local preSolveCheck = false
+ local postSolveCheck = false
+ local collisions = 0
+ world:setCallbacks(
+ function() beginContactCheck = true; collisions = collisions + 1 end,
+ function() endContactCheck = true end,
+ function() preSolveCheck = true end,
+ function() postSolveCheck = true end
+ )
+ local body2 = love.physics.newBody(world, 10, 10, 'dynamic')
+ local rectangle2 = love.physics.newRectangleShape(body2, 0, 0, 10, 10)
+ test:assertEquals(false, beginContactCheck, 'check world didnt update after adding body')
+ world:update(1)
+ test:assertEquals(true, beginContactCheck, 'check contact start')
+ test:assertEquals(true, preSolveCheck, 'check pre solve')
+ test:assertEquals(true, postSolveCheck, 'check post solve')
+ body2:setPosition(100, 100)
+ world:update(1)
+ test:assertEquals(true, endContactCheck, 'check contact end')
+ -- check point checking
+ local shapes = 0
+ world:queryShapesInArea(0, 0, 10, 10, function(x)
+ shapes = shapes + 1
+ end)
+ test:assertEquals(1, shapes, 'check shapes in area')
+ world:rayCast(0, 0, 200, 200, function(x)
+ shapes = shapes + 1
+ return 1
+ end)
+ test:assertEquals(3, shapes, 'check shapes in raycast')
+ -- change collision logic
+ test:assertEquals(nil, world:getContactFilter(), 'check def filter')
+ world:update(1)
+ world:setContactFilter(function(s1, s2)
+ return false -- nothing collides
+ end)
+ body2:setPosition(10, 10)
+ world:update(1)
+ test:assertEquals(1, collisions, 'check collision logic change')
+ -- final bits
+ world:setGravity(1, 1)
+ test:assertEquals(1, world:getGravity(), 'check grav change')
+ world:destroy()
+ test:assertEquals(true, world:isDestroyed(), 'check world destroyed')
end
@@ -54,14 +123,12 @@ end
-- love.physics.getDistance
love.test.physics.getDistance = function(test)
-- setup two fixtues to check
- local shape1 = love.physics.newEdgeShape(0, 0, 5, 5)
- local shape2 = love.physics.newEdgeShape(10, 10, 15, 15)
local world = love.physics.newWorld(0, 0, false)
local body = love.physics.newBody(world, 10, 10, 'static')
- local fixture1 = love.physics.newFixture(body, shape1, 1)
- local fixture2 = love.physics.newFixture(body, shape2, 1)
+ local shape1 = love.physics.newEdgeShape(body, 0, 0, 5, 5)
+ local shape2 = love.physics.newEdgeShape(body, 10, 10, 15, 15)
-- check distance between them
- test:assertEquals(647106, math.floor(love.physics.getDistance(fixture1, fixture2)*100000), 'check distance matches')
+ test:assertEquals(647106, math.floor(love.physics.getDistance(shape1, shape2)*100000), 'check distance matches')
end
@@ -85,14 +152,18 @@ end
-- love.physics.newChainShape
-- @NOTE this is just basic nil checking, objs have their own test method
love.test.physics.newChainShape = function(test)
- test:assertObject(love.physics.newChainShape(true, 0, 0, 1, 0, 1, 1, 0, 1))
+ local world = love.physics.newWorld(1, 1, true)
+ local body = love.physics.newBody(world, 10, 10, 'static')
+ test:assertObject(love.physics.newChainShape(body, true, 0, 0, 1, 0, 1, 1, 0, 1))
end
-- love.physics.newCircleShape
-- @NOTE this is just basic nil checking, objs have their own test method
love.test.physics.newCircleShape = function(test)
- test:assertObject(love.physics.newCircleShape(10))
+ local world = love.physics.newWorld(1, 1, true)
+ local body = love.physics.newBody(world, 10, 10, 'static')
+ test:assertObject(love.physics.newCircleShape(body, 10))
end
@@ -110,18 +181,9 @@ end
-- love.physics.newEdgeShape
-- @NOTE this is just basic nil checking, objs have their own test method
love.test.physics.newEdgeShape = function(test)
- local obj = love.physics.newEdgeShape(0, 0, 10, 10)
- test:assertObject(obj)
-end
-
-
--- love.physics.newFixture
--- @NOTE this is just basic nil checking, objs have their own test method
-love.test.physics.newFixture = function(test)
local world = love.physics.newWorld(1, 1, true)
local body = love.physics.newBody(world, 10, 10, 'static')
- local shape = love.physics.newCircleShape(10)
- local obj = love.physics.newFixture(body, shape, 1)
+ local obj = love.physics.newEdgeShape(body, 0, 0, 10, 10)
test:assertObject(obj)
end
@@ -176,7 +238,9 @@ end
-- love.physics.newPolygonShape
-- @NOTE this is just basic nil checking, objs have their own test method
love.test.physics.newPolygonShape = function(test)
- local obj = love.physics.newPolygonShape({0, 0, 2, 3, 2, 1, 3, 1, 5, 1})
+ local world = love.physics.newWorld(1, 1, true)
+ local body = love.physics.newBody(world, 10, 10, 'static')
+ local obj = love.physics.newPolygonShape(body, {0, 0, 2, 3, 2, 1, 3, 1, 5, 1})
test:assertObject(obj)
end
@@ -206,8 +270,10 @@ end
-- love.physics.newRectangleShape
-- @NOTE this is just basic nil checking, objs have their own test method
love.test.physics.newRectangleShape = function(test)
- local shape1 = love.physics.newRectangleShape(10, 20)
- local shape2 = love.physics.newRectangleShape(10, 10, 40, 30, 10)
+ local world = love.physics.newWorld(1, 1, true)
+ local body = love.physics.newBody(world, 10, 10, 'static')
+ local shape1 = love.physics.newRectangleShape(body, 10, 20)
+ local shape2 = love.physics.newRectangleShape(body, 10, 10, 40, 30, 10)
test:assertObject(shape1)
test:assertObject(shape2)
end