Skip to content

Add real unit tests for core math, util, UID, and shape logic#610

Merged
aalex merged 2 commits into
devfrom
claude/test-coverage-analysis-aopAm
May 23, 2026
Merged

Add real unit tests for core math, util, UID, and shape logic#610
aalex merged 2 commits into
devfrom
claude/test-coverage-analysis-aopAm

Conversation

@aalex
Copy link
Copy Markdown
Member

@aalex aalex commented May 23, 2026

Replace the placeholder TestMaths (which only exercised Qt's
QString::toUpper) with unit tests that cover production code:

  • TestMaths: degree/radian conversion, wrapAround, distance helpers, xOr
  • TestUtil: map_float/map_int range mapping and clipping, isNumeric,
    fileExists/eraseFile
  • TestUidAllocator: sequential allocation, lowest-id reuse, reserve, free
  • TestShape: vertex accessors, getCenter, includesPoint, translate,
    applyTransform, polygon round-trip

The test project compiles the real MapMap sources under test and runs
all suites from a single binary via a custom QtTest runner.

https://claude.ai/code/session_01BCDcXvWxedEm95hpuVyZYC

@aalex aalex force-pushed the claude/test-coverage-analysis-aopAm branch from 6986cfa to f5167c9 Compare May 23, 2026 19:35
aalex added 2 commits May 23, 2026 16:03
Replace the placeholder TestMaths (which only exercised Qt's
QString::toUpper) with unit tests that cover production code:

- TestMaths: degree/radian conversion, wrapAround, distance helpers, xOr
- TestUtil: map_float/map_int range mapping and clipping, isNumeric,
  fileExists/eraseFile
- TestUidAllocator: sequential allocation, lowest-id reuse, reserve, free
- TestShape: vertex accessors, getCenter, includesPoint, translate,
  applyTransform, polygon round-trip

The test project compiles the real MapMap sources under test and runs
all suites from a single binary via a custom QtTest runner.

Util.cpp uses glTexCoord2f and glVertex2f, which require -lopengl32
on Windows. The main project already links this via src.pri, but the
test project manages its own linkage independently.
@aalex aalex force-pushed the claude/test-coverage-analysis-aopAm branch from 2a67fff to 46d4d73 Compare May 23, 2026 20:03
@aalex aalex self-assigned this May 23, 2026
@aalex aalex added this to the 1.0 milestone May 23, 2026
@aalex aalex merged commit bb5708b into dev May 23, 2026
3 checks passed
@aalex aalex deleted the claude/test-coverage-analysis-aopAm branch May 23, 2026 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant