Skip to content

Feature/fase 1 test system#2

Merged
LyeZinho merged 21 commits intomainfrom
feature/fase-1-test-system
Apr 7, 2026
Merged

Feature/fase 1 test system#2
LyeZinho merged 21 commits intomainfrom
feature/fase-1-test-system

Conversation

@LyeZinho
Copy link
Copy Markdown
Member

@LyeZinho LyeZinho commented Apr 7, 2026

Branch: feature/fase-1-test-system

Summary:

Implements a complete test system for Caffeine Engine with Catch2 framework, covering all Phase 1 modules (Core, Memory, Containers, Math).
Changes:

  • Added Catch2 v2.13.10 header-only framework
  • Created 47+ test cases across 4 test files
  • Implemented stress tests (1M allocations, fragmentation check)
  • Added performance benchmarks
  • Configured GitHub Actions CI pipeline with build, ASan, and coverage
    Test Coverage:
  • Memory: LinearAllocator, PoolAllocator, StackAllocator (incl. stress tests)
  • Containers: Vector, HashMap, StringView, FixedString
  • Math: Vec2, Vec3, Vec4, Mat4, Math utilities
  • Core: Types, Platform, Compiler, Assertions
    CI Status: Ready for GitHub Actions validation

LyeZinho added 5 commits April 7, 2026 13:03
- Add Types.hpp with u32, f64, usize and static_assert validations
- Add Platform.hpp with CF_PLATFORM_WINDOWS/LINUX/MACOS macros
- Add Compiler.hpp with CF_INLINE, CF_NORETURN, CF_BUILTIN_TRAP
- Add Assertions.hpp with CF_ASSERT and CF_UNREACHABLE macros
- Add IAllocator interface with alloc/free/reset/usedMemory methods
- Add LinearAllocator with O(1) alloc, reset() clears all
- Add PoolAllocator with fixed-size slots, O(1) amortized
- Add StackAllocator with markers for nested scopes
- Add Vector.hpp with cache-friendly dynamic array
- Add HashMap.hpp with simple O(n) lookup
- Add StringView.hpp for zero-copy string references
- Add FixedString.hpp for stack-allocated strings
- Add Vec2, Vec3, Vec4 for 2D/3D math
- Add Mat4 with column-major matrix operations
- Add Math.hpp with utility functions (lerp, clamp, etc)
- Add Caffeine.hpp as unified include for all modules
- Add CMakeLists.txt with C++20 and test configuration
- Add basic test.cpp with allocator verification
- Update .gitignore with build artifacts
- Add test system design document to docs/plans/
- Define framework selection (Catch2)
- Document file structure and CI integration
@LyeZinho LyeZinho self-assigned this Apr 7, 2026
@LyeZinho LyeZinho added the test Testing features label Apr 7, 2026
LyeZinho added 16 commits April 7, 2026 13:58
- g++-13 with C++20
- g++-12 with C++17 (no C++20 support)
- Add explicit CMAKE_CXX_STANDARD to sanitize and coverage jobs
…lete

- Destructor: handle null allocator with global delete
- reserve(): use global ::operator new when m_allocator is null
- Move assignment: handle null allocator with global delete

This fixes the segfault when using Vector without passing an allocator.
- Math.hpp: isPowerOfTwo(0) should return false (not true)
- test_allocators.cpp: StackAllocator test expects 128 not 96 after realloc
- Mat4.hpp: transformPoint was using wrong Vec4 member access (x/y/z/w vs row indexing)

The transformPoint bug was using result.x/y/z/w but Vec4 has members not array access.
- Add comprehensive test summary documenting KISS, RHI, ECS, DOD, YAGNI,
  Lock-free, Archetype, Draw Call, Batch Rendering, SIMD, Cache Locality,
  Swapchain principles
- Document test coverage and fixes applied during development
@LyeZinho LyeZinho merged commit f858054 into main Apr 7, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test Testing features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant