User Manual for MinimumDraw Library Test Suite
The MinimumDraw Library (MDL) Test Suite is a comprehensive testing tool designed to validate and benchmark the functionality, performance, and reliability of the MDL version 0.92. This manual provides detailed instructions on how to use the test suite effectively.
Note: The MDL Test Suite is designed to work with the MinimumDraw Library version 0.92, which must be available in the same directory as the test suite.
The MinimumDraw Library is a lightweight graphics library originally created by UDI (http://udimac.web.fc2.com) and adapted by Michael Roberts. It provides a range of functions for buffer management, drawing primitives, color handling, pixel manipulation, text rendering, and visual effects.
The test suite serves several key purposes:
Note: If the "MDL" button in the top-right corner of the test suite shows green, the library is loaded correctly. If it shows white, you'll need to click it to load the library manually.
The test suite interface is organized into several key areas:
The test suite includes the following test categories:
Tests core buffer operations, memory tracking, buffer stack operations, and buffer manipulation functions.
Key tests: MdMakeBuffer, MdNewBuffer, MdPushBuffer, MdPopBuffer, MdFillScreen, MdEraseScreen, MdScroll
Tests basic shape drawing, filled vs. outline shapes, and validates proper clipping behavior.
Key tests: MdDrawLine, MdDrawRect, MdDrawOval, MdDrawDia, MdDrawStar
Tests color setting, retrieval, blending operations, and color format handling.
Key tests: MdSetPenColor, MdGetPenColor, MdSetBgColor, MdGetBgColor, MdGetBlendColor
Tests individual pixel operations, pixel arrays, and alpha channel handling.
Key tests: MdSetPixel, MdGetPixel, MdDrawPix, MdDrawPixPat, MdSetPixAlpha
Tests vector text drawing and 7-segment number display.
Key tests: MdDrawText, MdDrawVec, MdDrawNumber, MdDrawSegment
Tests visual transitions and effects.
Key tests: MdGetEffectList, MdUpdate with various effects
Tests rectangle operations, location utilities, and data handling functions.
Key tests: MdPackRect, MdUnpackRect, MdOffsetRect, MdSwap, MdShuffleItems
Tests memory usage tracking, buffer pooling efficiency, and checks for memory leaks.
Key tests: Buffer memory usage, multi-buffer operations, memory leak detection
Determines the size of the test canvas:
Controls the thoroughness and speed of testing:
When enabled, shows detailed technical information in the debug output area, helpful for diagnosing issues.
Tip: For first-time users, it's recommended to start with just the "Buffer Management" category at "Normal" speed to verify basic functionality.
For a quick check that the MDL library is working correctly:
To visually verify drawing operations:
For thorough validation, including memory leak detection:
The "MDL" button in the top-right corner controls the usage of the MDL library:
Click the button to toggle between loading and unloading the library.
After running tests, the Test Summary area displays:
The background color indicates overall success:
The Test Results area shows detailed information for each test:
For failed tests, additional information is shown:
When Debug Mode is enabled, this area shows technical details such as:
The test suite allows you to export test results for documentation or further analysis:
Tip: Exported logs are particularly useful for regression testing - save logs from different versions of the MDL library for comparison.
The test suite is designed to be extensible. If you need to add custom tests:
logTestResult
handler to report resultsExample of a custom test handler:
on testMyCustomFeature
local tPassed, tStartTime, tEndTime, tResult, tExpected
try
-- Setup test conditions
MdSetPenColor "255,0,0"
-- Measure execution time
put the milliseconds into tStartTime
-- Run the MDL function being tested
put myMDLFunction() into tResult
put the milliseconds into tEndTime
-- Verify results
put "expected value" into tExpected
put (tResult = tExpected) into tPassed
-- Log results
logTestResult "MyCustomTest", tPassed, \
"Test description in " & (tEndTime - tStartTime) & "ms", \
tExpected, tResult
catch tError
logTestResult "MyCustomTest", false, tError
end try
debugLog "Detailed diagnostic information"
end testMyCustomFeature
The test suite includes performance benchmarking for various MDL operations:
The fastest operations are typically line drawing and pixel setting, while operations involving alpha blending or complex shapes are slower.
For detailed performance analysis, run with Debug Mode enabled and look for execution times in the Debug Output area.
The Memory Management test category is particularly useful for identifying potential memory issues:
Watch for unexpectedly high memory differences after operations, which may indicate memory leaks.
Issue | Possible Causes | Solution |
---|---|---|
"MDL" button is white, not green | MDL library not loaded | Click the "MDL" button to load the library or ensure lib_MDL_0.92.livecode is in the resources folder |
Tests failing in "Buffer Management" | Fundamental MDL issue or incorrect library version | Verify you're using MDL version 0.92, check library path |
Visual tests show no output | Test canvas not visible or improperly initialized | Reset test canvas, try increasing canvas size, or restart test suite |
Tests running very slowly | Thorough mode or large canvas size | Switch to "Fast" mode or reduce canvas size to "200 x 200" |
Memory leak warnings | Genuine leaks or temporary memory allocation | Run memory tests again to confirm, check Debug Output for details |
Test suite crashes | Out of memory or stack overflow | Increase LiveCode memory limits, run fewer tests at once |
If you encounter issues not covered in this manual:
The MDL Test Suite provides a comprehensive framework for validating and benchmarking the MinimumDraw Library. By regularly running these tests, you can ensure that the library is functioning correctly and efficiently in your environment.
Note: This user manual is for version 1.0 of the MDL Test Suite, designed for MDL library version 0.92. Future versions of either component may require updated testing procedures.