Skip to content

The small libraries' tests check what they say they check - #450

Merged
RyeMutt merged 4 commits into
rye/tests-tm18from
rye/tm18-test-fixes
Oct 12, 2026
Merged

RyeMutt merged 4 commits into
rye/tests-tm18from
rye/tm18-test-fixes

Conversation

@RyeMutt

@RyeMutt RyeMutt commented Oct 12, 2026

Copy link
Copy Markdown
Member

Description

Fixes the bugs in the small libraries' own tests that the Catch2 conversion in #449 found and kept, since a conversion must not change what a test does. Each was a test that could not fail for the reason it existed, checked something other than what it said, could crash where it should fail, or leaked. None of the corrected tests found a bug in the code they test.

It stacks on #449 (rye/tests-tm18) and changes only test files.

llcharacter (d241423)

  • lljoint: after addChild, a check repeated an earlier one. It now checks the parent it meant.
  • llcharacter: a joint's parent, and a motion findMotion found, were dereferenced unchecked. Each is now REQUIREd first.
  • llpose: a case said an unnumbered joint is left out of the motion's joint signature, but never looked. The test motion now exposes the signature, and the case checks that no byte of it is set.
  • llmultigesture: the sound step's flags were never read back, and the read-back case looked at two of four steps. Every field of every step is now compared.
  • llbvhloader: results were indexed with no joint count checked; each is now REQUIREd. A case said every joint gets the global priority but looked at one. Two refusals shared a message.
  • llkeyframemotion: a U32 cursor was compared through LLSDEquals; it is now compared as an integer.

llxml and llinventory (741c56e)

  • alxmllayermerge: "hears nothing once it is gone" checked an observer that was never installed, so it could not fail.
  • llcontrol: the listener flag was a static that was never reset. It now belongs to the fixture.
  • llpermissions:
    • the allowCopyBy case called allowModifyBy;
    • the three allow*By cases were asked only under the default masks, where everyone may. They now give the owner, the group and everyone masks of their own in turn, and ask the owner, a member asking as the group, the same member without it, and a stranger;
    • a transfer value was read and thrown away. It is now checked.
  • inventorymisc: three fromLLSD results were never checked. An empty placeholder case for a removed XML export goes.
  • llsaleinfo:
    • a sale info was built and never used;
    • the message-packing placeholder becomes a round trip through the LLSD forms of packMessage and unpackMessage.
  • llsettingssky: two profiles were indexed with no size checked.
  • Cleanup: a commented-out TUT stub goes, and six files' @file lines lose their TUT-era names.

llprimitive, llimage and lldir (4b5331b)

  • llgltfmaterial:
    • the transforms-only material was given texture IDs, so its round trip was never tested;
    • the flagged-default-overrides block set the override material twice and left the render material at its defaults. It now sets the render material, and a new block checks that the same defaults without the flags change nothing.
  • llmaterial: the case named for fromLLSD invalidating the hash cache could not fail for that reason. The cache was already dirty when fromLLSD ran.
  • llprimitive: createPrimitive's result leaked.
  • llimageworker: the responder's done flag was a plain bool written on a worker thread and polled on the main one. It pointed into the test's stack, and a responder finishing after the timeout would write through that pointer. It is now an atomic, which the responder shares ownership of.
  • lldir: comments named directories and patterns the code does not use.

Related Issues

  • Please link to a relevant GitHub issue for additional context.

Issue Link: none. The bugs were found by #449's idiom pass and listed in 3bbc58d's message.


Checklist

  • I have provided a clear title and detailed description for this pull request.
  • If useful, I have included media such as screenshots and video to show off my changes.
  • I have tested the changes locally and verified they work as intended.
  • All new and existing tests pass.
  • Code follows the project's style guidelines.
  • Documentation has been updated if needed.
  • Any dependent changes have been merged and published in downstream modules.
  • I have reviewed the contributing guidelines.

Additional Notes

  • Tested on macOS arm64, RelWithDebInfo, on Test framework, stage 3: the small libraries' tests in Catch2 #449's head (fac126b):
    • all 38 entries of TM18's eight binaries pass;
    • each binary passes 10 random orders with no state guard report;
    • assertions changed only where described: llcharacter 38,083 → 38,119; llinventory 356 in 58 cases → 378 in 57; llprimitive 333 → 335.
  • Each new or corrected check fails when it should. Each was run under a small change to the test's own input or expected value; it failed, and nothing else did. The changes were then reverted.
    • The exception is inventorymisc's parse checks: LLInventoryItem::fromLLSD returns true whatever it is given.
  • Merge order: this should follow Test framework, stage 3: the small libraries' tests in Catch2 #449. Once Test framework, stage 3: the small libraries' tests in Catch2 #449 merges, its base becomes develop.
  • Not changed here, found on the way: LLGLTFMaterial::applyOverride calls mTrackingIdToLocalTexture.insert(it, it). That is std::map's range insert over an empty range, so an override's local-texture tracking is never merged in. It is production code and wants its own change.

🤖 Generated with Claude Code

RyeMutt and others added 3 commits October 12, 2026 03:04
The Catch2 conversion kept these as TUT had them; now they are fixed:
- lljoint: after addChild, a check repeated an earlier one where it
  meant that lljoint's parent is now lljointgp. It checks that.
- llcharacter: a joint's parent, and a motion findMotion found, were
  dereferenced unchecked. Each is REQUIREd first, so a failure fails the
  case rather than crashing the run.
- llpose: a case said an unnumbered joint is left out of the motion's
  joint signature and never looked. ALTestMotion exposes the signature,
  and the case checks that no byte of it is set; LLMotion writing one at
  joint number -1 would set the last byte of the row before.
- llmultigesture: the sound step's flags were never read back, and the
  read-back case looked at two of four steps. Every field of every step
  is now compared with what was written, and the sample gesture's sound
  and chat steps carry flags, so a reader that skipped them would show.
- llbvhloader: results were indexed with no joint count checked first;
  each is REQUIREd now. One case said every joint is given the global
  priority and looked at one. Two refusals shared a message.
- llkeyframemotion: a U32 cursor was compared through LLSDEquals, as
  TUT's overload for a string message chose; it is compared as the
  integer it is.

Each new or corrected check was shown to fail under a small change to the
test's own input or expected value, and to pass as written. All of
llcharacter_tests passes in 10 random orders: 38,119 assertions in 143
cases (38,083 before).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- alxmllayermerge: the check that an observer hears nothing once it is
  gone looked at an observer never installed, so it could not fail. It
  checks the one that was installed and then removed.
- llcontrol: the listener flag was a static never reset, so a second
  run of the case in one process passed whether or not the listener
  fired. It is the fixture's, set by a lambda.
- llpermissions:
  - the allowCopyBy case called allowModifyBy;
  - allowModifyBy, allowCopyBy and allowMoveBy were asked only under
    the default masks, where everyone may. Each case now gives the
    owner, the group and everyone their own masks in turn, and asks the
    owner, a member as the group, the same member without it, and a
    stranger. Modify stays refused to everyone, which fix() enforces;
  - a getValue(PERM_TRANSFER) result was thrown away. The transfer
    value is checked after each aggregate.
- inventorymisc: three fromLLSD results were never checked, and a case
  left as a placeholder for a removed XML export asserted nothing and
  goes.
- llsaleinfo: a sale info was built and never used; the lookup now goes
  through it. The placeholder for message packing becomes a round trip
  through packMessage and unpackMessage's LLSD forms, which need no
  message system.
- llsettingssky: two profiles were indexed with no size checked.
- lluserrelations loses a commented-out TUT stub. Six files' @file
  lines gave their TUT-era names.

Each new or corrected check was shown to fail under a small change to the
test's own input or expected value; inventorymisc's parse checks cannot
be made to, since LLInventoryItem::fromLLSD returns true whatever it is
given. llxml_tests passes 223 assertions in 25 cases, and
llinventory_tests 378 in 57 (356 in 58 before), in 10 random orders.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…heck

- llgltfmaterial:
  - the texture-transforms-only material was given texture ids, so its
    JSON round trip was never tested; it is given transforms;
  - the block meant to show that flagged default overrides put a
    non-default material back set the override material twice and left
    the render material default. It sets the render material. A third
    block shows that the same defaults without the flags change
    nothing;
  - a comment pointed at "test<12>"; it names the case.
- llmaterial: the case named for fromLLSD invalidating the hash cache
  could not fail for that reason: the cache was dirty already when
  fromLLSD ran, and its last check went through a setter. The hash is
  cached before each fromLLSD now, and the second goes through LLSD.
- llprimitive: createPrimitive's result leaked; a unique_ptr holds it.
- llimageworker: the responder's done flag was a plain bool written on
  a worker thread and polled on the main one, through a pointer into the
  test's stack that a responder finishing after the timeout would write
  through. It is an atomic the responder shares ownership of.
- lldir: comments in the directory scan case named directories and
  patterns the code does not use.

Each new or corrected check was shown to fail under a small change to the
test's own input or expected value. llprimitive_tests passes 335
assertions in 45 cases (333 before), and with llprimitive_test,
llimageworker_test and llfilesystem_tests passes in 10 random orders.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You'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 3 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 23ed7be6-b5d6-44ca-82fb-59a7555d0abb

📥 Commits

Reviewing files that changed from the base of the PR and between 4ddc9d0 and 74800ec.


📒 Files selected for processing (20)
  • indra/llcharacter/tests/altestmotion.h
  • indra/llcharacter/tests/llbvhloader_test.cpp
  • indra/llcharacter/tests/llcharacter_test.cpp
  • indra/llcharacter/tests/lljoint_test.cpp
  • indra/llcharacter/tests/llkeyframemotion_test.cpp
  • indra/llcharacter/tests/llmultigesture_test.cpp
  • indra/llcharacter/tests/llpose_test.cpp
  • indra/llfilesystem/tests/lldir_test.cpp
  • indra/llimage/tests/llimageworker_test.cpp
  • indra/llinventory/tests/inventorymisc_test.cpp
  • indra/llinventory/tests/llparcel_test.cpp
  • indra/llinventory/tests/llpermissions_test.cpp
  • indra/llinventory/tests/llsaleinfo_test.cpp
  • indra/llinventory/tests/llsettingssky_test.cpp
  • indra/llinventory/tests/lluserrelations_test.cpp
  • indra/llprimitive/tests/llgltfmaterial_test.cpp
  • indra/llprimitive/tests/llmaterial_test.cpp
  • indra/llprimitive/tests/llprimitive_test.cpp
  • indra/llxml/tests/alxmllayermerge_test.cpp
  • indra/llxml/tests/llcontrol_test.cpp

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@RyeMutt
RyeMutt merged commit a0682b5 into develop Oct 12, 2026
15 checks passed
@RyeMutt
RyeMutt deleted the rye/tm18-test-fixes branch October 12, 2026 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant