Repository navigation
Test framework: fix the old test bugs in llrender's tests - #469
Merged
Merged
Conversation
Old test bugs TM22's idiom pass found (bb3f752), fixed. - llfontregistry: - "operator< orders descriptors that differ only in style" gave both the same size, so whether style is compared before size was never tested; the lower style now has the later size; - getMatchingFontDesc's normalization was never queried: a BOLD style and a "SansSerifBold" query now need it. The comment's "SansSerifHuge" could not work: normalizing moves Huge into the size, so the query names a head, not a template; - a second resolveFontReferences promised to keep the size table and the source-family tags and checked only the file count; it checks both now; - the sweep case's CHECK(true) is gone: the case passes by returning, and now checks the map holds the entry it walks; - a family that <use>s itself was tested twice, once under a comment naming a 'self' alias there is none of; the second is gone; - templateFor() results and getFontFiles()[0] are required before they are read. - llfontregistry_gl: - each case requires its font's freetype before reading through it, and case 1's existing REQUIRE moved ahead of the first read; - after an eviction, a glyph's entry naming no sheet (Unspecified, -1) passed the "not released" checks; the entry is checked to name a Color sheet first. Each new or corrected check fails under a small change to the test's own input or expectation, at the check and not by crashing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Old test bugs TM22's idiom pass found (bb3f752), fixed. - llfontgl: - the vertical alignment case's comment named VCENTER, which it never rendered; it renders it now; - the reflow bound took a wrap's shape count for its line count, so "two shapes a line" was looser than it said; each width's wrap now counts its lines; - the run-end case passed with no assertion if no sample had a width; it checks that some were measured; - two frame comparisons compared 256x256 pixel vectors with ==, so a failure printed some 262,000 values; they count the pixels that differ and show the first; - freetypes, bitmap caches and fonts are required before they are read; - the file's header said each case had a registry of its own; the registry is the binary's. - llfonttextcache: - five CHECK(true)s: two cases now pass by returning, as they meant; the toggles case reads each toggle's effect off regenCount() and a draw; - "resets twice and outlives a toggle" repeated another case and the toggles case, and is gone; - the generation-tick case rasterized É, which an earlier case could already have drawn, and never checked that the cache measured again; it takes a glyph nothing has drawn and reads the shaper; - "a reset leaves another cache alone" measured the same text in both, so a shared slot could not show; they measure different texts; - the five render cases checked only counts. Each now shows which way the draw went, through regenCount() and the pixels it left: a repeat replays, a colour change recolors in place (and draws red), a move rebuilds by 100 pixels, a style flip rebuilds, and with the fast path off a colour change rebuilds. The file's header no longer says the harness cannot test that. Each new or corrected check fails under a small change to the test's own input or expectation, at the check and not by crashing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Old test bugs TM22's idiom pass found (bb3f752), fixed. - alfontshaping: - three cases asked for SourceHanSans-Regular.woff2, which the font package does not ship, so they always skipped; they load face 0 of SourceHanSans-VF.otf.ttc, which fonts.xml's CJK font loads, and run; - the cache cases checked a repeat's glyph count, never that it hit the cache, nor that a cleared face's entry was dropped; they read the shape cache's size and mutation count, and compare the glyphs themselves. a_addr, set and never read, is gone; - the tag-sequence bound compared a byte count where it meant codepoints; - the combining-mark case's GPOS branch never ran (DejaVuSansMono composes a + U+0301), and checked no offset; a q + U+0301 probe, which cannot compose, now reaches it, and its x offset is checked; - the load-flags check compared FT_Int32 with int, which cannot differ; it loads at light hinting and checks HarfBuzz is given it; - fonts' faces are required before they are read, and the variation case's FT_MM_Var is owned, so a failure does not leak it. - alfontshaping_gl: the kerning check followed a SKIP for the same condition, so it could not fail; DejaVuSans kerns, and the SKIP is gone. - alfontcolrv1: - "a second paint" never compared the two; it compares the bytes with a fresh painter's; - the size bound said three times the point size and checked four; - the no-scale case zeroed the ppem, already 0, not the scale its comment named, so it never reached the 2-em fallback; it zeroes the scale now and checks the surface the fallback sizes; - the black-floor case skipped for want of a pure-black pixel and checked only the first; it paints U+1F576, which has 28, and checks every one; - the palette case's count check followed a SKIP for the same condition; the count is checked before painting. Noto-COLRv1 ships one palette, so the case still skips here; - faces, HarfBuzz fonts and bitmaps are required before they are read. - alfontcolrv1_gl: the force-monochrome case checked its own ternary; it asks for Grayscale directly, and sForceMonochromeEmoji is put back however the case ends. Caches, faces and HarfBuzz fonts are required before they are read. Each new or corrected check fails under a small change to the test's own input or expectation, at the check and not by crashing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hey say they check Old test bugs TM22's idiom pass found (bb3f752), fixed. - llfontfreetype: - CHECK(face->isValid()) could not fail: getOrCreateFace returns null for a face that does not load. Where nothing required the face, it is a REQUIRE that it is not null; where something did, it is gone. One stays, after resetBitmapCache, which a broken reset would fail; - faces loadFt returned are required before they are read; - the dark-palette check followed a SKIP for the same condition; the expected index now comes from FreeType's palette flags, and the global flag is put back however the case ends; - the CJK fallback case asked for a font the package does not ship, so it always skipped; it loads face 0 of SourceHanSans-VF.otf.ttc; - hasSvg had no positive case; TwemojiSVG is one; - the functor case's 'a' was not in TwemojiSVG at all, so the functor was never what kept the fallback from it; it uses U+2600, which both fonts have; - the refcount case compared addresses, which a freed and reused block can repeat; a reload is read off the atlas generation; - comments promised a match with FT_Get_Char_Index and a cleared atlas; both are checked now, and a third comment is corrected; - a CHECK(true) is gone. - llfontfreetype_gl: - the throttle case could not see the throttle, since nothing was idle; it moves the frame clock (and puts it back) so the second call comes past the idle threshold but within the interval; - two "not released" checks also held for an index past the end; the index is checked to name a sheet. - llfontbitmapcache: the generation was read before init(), whose reset bumps it, so "a reset bumps it" passed even if reset did not. - llfontbitmapcache_gl: two comments still said vertex buffers compare the global generation. - lluitransform: after a pop only the X scale was checked. Each new or corrected check fails under a small change to the test's own input or expectation, at the check and not by crashing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Old test bugs TM22's idiom pass found (bb3f752), fixed. - llglslshader_gl: - the uniform readers never checked a uniform's location, so a missing one read zeros, and every zero expected passed; each location is required, and so is a list of at most four values; - storage binding points and texture units were used unchecked, where a -1 would end the process in an llassert or leave a check passing for want of anything to read; they are required. - llimagegl: - the mip chain case checked mip 1's width, which glTexStorage2D gives every level whether or not mips were made; it reads mip 1 back and checks it holds the base's colour; - a binding was read just after the test bound the same name itself; the texture is bound through LLRender's slot now; - the texel reader indexed unchecked, sized from the image's size, not GL's; it reads GL's and fails on a texel outside it; - a readback was compared over the full size after checking only its width; its height and components are required too; - "destroyGLTexture leaves the image usable" never used it; it takes a new upload. - algpubuffer_gl: readAll ignored read()'s result, so a failed read showed only as 0xFFFFFFFF words. - alimageslot_gl: its fixture comment named the wrong targets and the wrong reason to skip. - alinfiniteprojection_gl: each occlusion query was deleted only at its case's end, so a failed REQUIRE leaked it on the shared context; the fixture owns it. - alwindowsdlheadless: the worker never checked that its shared context became current, so with none its GL calls did nothing and its error said nothing. It records what the platform reports (WGL, CGL, or EGL through SDL, as llsdl makes the context), makes the texture only then, and the test's thread requires it. A REQUIRE that guarded nothing is a CHECK. Each new or corrected check fails under a small change to the test's own input or expectation, at the check and not by crashing. Most of llglslshader's and all of alimageslot's and three of alinfiniteprojection's run only where the context has compute or clip control, so their changes were compiled here and not run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 52 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
5 of 9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes bugs in llrender's own tests. The TM22 Catch2 conversion found these bugs and kept them, because a conversion must not change what a test does. Each fixed test was one that:
It stacks on #468 (
rye/tests-tm22) and changes only test files.Font registry (3fa253c)
getMatchingFontDesc's normalization is now queried; nothing ever reached it before.<use>case that duplicated another is gone.templateFor()results,getFontFiles()[0], and the GL cases' freetypes are required before they are read.LLFontGL and LLFontTextCache (b4e7499)
regenCount()and the pixels: replay, recolor in place, or rebuild.Shaping and COLRv1 (585512b)
FreeType, bitmap caches, UI transform (8e022b5)
CHECK(face->isValid()): it could not fail. It is now a required non-null face, or gone where one was already required.init()'s own reset.GL objects (fae1eb9)
destroyGLTexture: the image now takes a new upload.Related Issues
Issue Link: none. The bugs were found by #468's idiom pass and listed in bb3f752's message.
Checklist
Additional Notes
🤖 Generated with Claude Code