Skip to content

Commit 98e2378

Browse files
committed
fix windows tests
1 parent 4aac16b commit 98e2378

3 files changed

Lines changed: 15 additions & 3 deletions

File tree

tests/test_charts.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// test_charts.cpp
22
// Unit tests for chart classes (logic only, no draw() calls)
3-
#include "doctest/doctest.h"
3+
4+
// IMPORTANT: On Windows, raylib.h must be included BEFORE other headers
5+
// to avoid conflicts with Windows SDK (Rectangle, CloseWindow, etc.)
46
#include "RLBarChart.h"
57
#include "RLBubble.h"
68
#include "RLCandlestickChart.h"
@@ -14,6 +16,8 @@
1416
#include "RLTimeSeries.h"
1517
#include "RLTreeMap.h"
1618

19+
#include "doctest/doctest.h"
20+
1721
// Global flag from test_main.cpp indicating raylib availability
1822
extern bool gRaylibAvailable;
1923

tests/test_common.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
// test_common.cpp
22
// Unit tests for RLCommon.h utility functions
3-
#include "doctest/doctest.h"
3+
4+
// IMPORTANT: On Windows, raylib.h must be included BEFORE other headers
5+
// to avoid conflicts with Windows SDK (Rectangle, CloseWindow, etc.)
46
#include "RLCommon.h"
7+
8+
#include "doctest/doctest.h"
59
#include <cmath>
610

711
TEST_SUITE("RLCommon") {

tests/test_main.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
// test_main.cpp
22
// Doctest entry point with optional headless raylib initialization
3+
4+
// IMPORTANT: On Windows, raylib.h must be included BEFORE standard library headers
5+
// to avoid conflicts with Windows SDK (Rectangle, CloseWindow, LoadImage, etc.)
6+
#include "raylib.h"
7+
38
#define DOCTEST_CONFIG_IMPLEMENT
49
#include "doctest/doctest.h"
5-
#include "raylib.h"
610
#include <cstdlib>
711
#include <cstdio>
812

0 commit comments

Comments
 (0)