test: add host-side unit tests for stats.h pure logic#37
Closed
Swissola wants to merge 4 commits into
Closed
Conversation
sleep=Donald Duck, idle=Bongo Cat, busy=SpongeBob multitasking, attention=Surprised Pikachu (Nouns glasses), celebrate=Peanuts party, dizzy=Powerpuff Girls spiral eyes, heart=heart eyes ghost. Source GIFs in characters/memes-src/, device-ready pack in characters/memes/. Built with prep_character.py at 96x98px, 64 colours per frame. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Track the current peer BD address in onConnect (extended overload). bleRemoveCurrentBond() removes only that peer's LTK from NVS. The "unpair" JSON command now calls this instead of bleClearBonds(), so each host unpairs itself independently. bleClearBonds() is reserved for factory reset only. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
PlatformIO native environment + Unity test framework covering: - statsMedianVelocity: empty, single, odd/even counts, ring wrap - statsMoodTier: velocity tiers, denial penalty thresholds, floor - statsEnergyTier: boot default, wake, 2h drain cadence - statsFedProgress: pip boundaries, level-up reset - statsOnBridgeTokens: first-packet latch, delta, restart resync, level-up Run with: pio test -e native (requires GCC/MinGW or MSVC on PATH) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Unity source is now part of the repo so no curl step is needed. Run command in test_main.cpp updated accordingly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Author
|
Closing as this is outside the scope of the upstream reference implementation per CONTRIBUTING.md. This change is maintained in the community fork at https://github.com/Swissola/claude-desktop-buddy — see the |
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.
Summary
nativeenvironment toplatformio.inistats.hMotivation
stats.hcontains non-trivial pure logic — median calculation, mood tier thresholds, energy drain, token level progression — that was previously only verifiable by flashing the device. These functions have no hardware dependency and are exactly the kind of thing a unit test suite should cover.To run:
pio test -e native(requires GCC/MinGW or MSVC on PATH)Coverage
statsMedianVelocitystatsMoodTierstatsEnergyTierstatsFedProgressstatsOnBridgeTokensNotes
test/stubs/contains minimal no-op stubs forArduino.handPreferences.h_mock_millisin the Arduino stub lets tests control the clock preciselysetUp()resets all file-static state between tests🤖 Generated with Claude Code