Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Tests/TestChromeTracing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ TEST(ChromeTracing_ScopeGuard)
{
SPARK_CHROME_TRACE_SCOPE("ScopedTest");
// Some work
volatile int x = 0;
for (int i = 0; i < 100; i++)
volatile unsigned int x = 0;
for (unsigned int i = 0; i < 100; i++)
x += i;
}

Expand Down
24 changes: 12 additions & 12 deletions Tests/TestDebugUtilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ TEST(CpuDebugger_BasicTiming)

cd.BeginSection("TestSection", "General", __FILE__, __LINE__, __FUNCTION__);
// Small busy-wait to ensure measurable time
volatile int x = 0;
for (int i = 0; i < 10000; ++i)
volatile unsigned int x = 0;
for (unsigned int i = 0; i < 10000; ++i)
x += i;
cd.EndSection("TestSection");

Expand All @@ -48,8 +48,8 @@ TEST(CpuDebugger_SectionStats)
for (int i = 0; i < 10; ++i)
{
cd.BeginSection("Repeated", "Test");
volatile int x = 0;
for (int j = 0; j < 1000; ++j)
volatile unsigned int x = 0;
for (unsigned int j = 0; j < 1000; ++j)
x += j;
cd.EndSection("Repeated");
}
Expand All @@ -72,8 +72,8 @@ TEST(CpuDebugger_HotSpots)
cd.EndSection("FastSection");

cd.BeginSection("SlowSection", "General", "fileB.cpp", 20, "funcB");
volatile int x = 0;
for (int i = 0; i < 100000; ++i)
volatile unsigned int x = 0;
for (unsigned int i = 0; i < 100000; ++i)
x += i;
cd.EndSection("SlowSection");

Expand All @@ -89,8 +89,8 @@ TEST(CpuDebugger_ScopedSection)

{
Spark::ScopedCpuSection section("ScopedTest", "General", __FILE__, __LINE__, __FUNCTION__);
volatile int x = 0;
for (int i = 0; i < 1000; ++i)
volatile unsigned int x = 0;
for (unsigned int i = 0; i < 1000; ++i)
x += i;
}

Expand Down Expand Up @@ -137,8 +137,8 @@ TEST(CpuDebugger_P99Calculation)
for (int i = 0; i < 100; ++i)
{
cd.BeginSection("P99Test", "Test");
volatile int x = 0;
for (int j = 0; j < 1000; ++j)
volatile unsigned int x = 0;
for (unsigned int j = 0; j < 1000; ++j)
x += j;
cd.EndSection("P99Test");
}
Expand Down Expand Up @@ -469,8 +469,8 @@ TEST(ThreadDebugger_ContentionTracking)
// Simulate a mutex wait
td.RecordMutexWaitBegin("RenderMutex", __FILE__, __LINE__);
// Small delay to simulate contention
volatile int x = 0;
for (int i = 0; i < 10000; ++i)
volatile unsigned int x = 0;
for (unsigned int i = 0; i < 10000; ++i)
x += i;
td.RecordMutexWaitEnd("RenderMutex");

Expand Down
16 changes: 8 additions & 8 deletions Tests/TestProfiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ TEST(Profiler_BeginEndSection)
p.BeginSection("TestSection", ProfileCategory::GameLogic);

// Small busy-wait to ensure measurable time
volatile int x = 0;
for (int i = 0; i < 100000; ++i)
volatile unsigned int x = 0;
for (unsigned int i = 0; i < 100000; ++i)
x += i;

p.EndSection("TestSection");
Expand Down Expand Up @@ -111,8 +111,8 @@ TEST(Profiler_BeginEndFrame)

p.BeginFrame();

volatile int x = 0;
for (int i = 0; i < 10000; ++i)
volatile unsigned int x = 0;
for (unsigned int i = 0; i < 10000; ++i)
x += i;

p.EndFrame();
Expand Down Expand Up @@ -181,8 +181,8 @@ TEST(Profiler_CategoryTimeMs)
p.SetEnabled(true);

p.BeginSection("RenderWork", ProfileCategory::Render);
volatile int x = 0;
for (int i = 0; i < 10000; ++i)
volatile unsigned int x = 0;
for (unsigned int i = 0; i < 10000; ++i)
x += i;
p.EndSection("RenderWork");

Expand Down Expand Up @@ -291,8 +291,8 @@ TEST(Profiler_ScopedProfileTimer)

{
ScopedProfileTimer timer("ScopedTest", ProfileCategory::GameLogic);
volatile int x = 0;
for (int i = 0; i < 10000; ++i)
volatile unsigned int x = 0;
for (unsigned int i = 0; i < 10000; ++i)
x += i;
}

Expand Down
Loading