summaryrefslogtreecommitdiff
path: root/test/perf-geoData.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan.goodliffe@octal.co.uk>2025-04-28 09:37:00 +0100
committerDan Goodliffe <dan.goodliffe@octal.co.uk>2025-04-28 09:37:00 +0100
commit0adc6ba15c8a44b23bfe7477ea94a746536329d7 (patch)
treea40404a3ceee30a863d0cc96c3713c5fd5f9402c /test/perf-geoData.cpp
parentFix all warnings in enumeration details code/tests (diff)
downloadilt-0adc6ba15c8a44b23bfe7477ea94a746536329d7.tar.bz2
ilt-0adc6ba15c8a44b23bfe7477ea94a746536329d7.tar.xz
ilt-0adc6ba15c8a44b23bfe7477ea94a746536329d7.zip
Fix all warnings in performance tests
Diffstat (limited to 'test/perf-geoData.cpp')
-rw-r--r--test/perf-geoData.cpp38
1 files changed, 19 insertions, 19 deletions
diff --git a/test/perf-geoData.cpp b/test/perf-geoData.cpp
index d9ea8c6..4eff357 100644
--- a/test/perf-geoData.cpp
+++ b/test/perf-geoData.cpp
@@ -2,56 +2,56 @@
#include <game/geoData.h>
namespace {
- const GeoData tm {GeoData::loadFromAsciiGrid(FIXTURESDIR "height/SD19.asc")};
+ const GeoData geoDataFixture {GeoData::loadFromAsciiGrid(FIXTURESDIR "height/SD19.asc")};
void
- terrain_findPoint(benchmark::State & state)
+ terrainFindPoint(benchmark::State & state)
{
- for (auto _ : state) {
- benchmark::DoNotOptimize(tm.findPoint({315555000, 495556000}));
+ for (auto loop : state) {
+ benchmark::DoNotOptimize(geoDataFixture.findPoint({315555000, 495556000}));
}
}
void
- terrain_walk(benchmark::State & state)
+ terrainWalk(benchmark::State & state)
{
const glm::vec2 point {310001000, 490000000};
- const GeoData::PointFace start {point, tm.findPoint(point)};
- for (auto _ : state) {
- tm.walk(start, {319999000, 500000000}, [](auto f) {
- benchmark::DoNotOptimize(f);
+ const GeoData::PointFace start {point, geoDataFixture.findPoint(point)};
+ for (auto loop : state) {
+ geoDataFixture.walk(start, {319999000, 500000000}, [](auto step) {
+ benchmark::DoNotOptimize(step);
});
}
}
void
- terrain_walkBoundary(benchmark::State & state)
+ terrainWalkBoundary(benchmark::State & state)
{
- for (auto _ : state) {
- tm.boundaryWalk([](auto heh) {
+ for (auto loop : state) {
+ geoDataFixture.boundaryWalk([](auto heh) {
benchmark::DoNotOptimize(heh);
});
}
}
void
- terrain_deform(benchmark::State & state)
+ terrainDeform(benchmark::State & state)
{
std::array<GlobalPosition3D, 3> points {{
{315555000, 495556000, 0},
{315655000, 495556000, 0},
{315655000, 495557000, 0},
}};
- for (auto _ : state) {
- auto geoData {tm};
+ for (auto loop : state) {
+ auto geoData {geoDataFixture};
benchmark::DoNotOptimize(geoData.setHeights(points, GeoData::SetHeightsOpts {.surface = nullptr}));
}
}
}
-BENCHMARK(terrain_findPoint);
-BENCHMARK(terrain_walk);
-BENCHMARK(terrain_walkBoundary);
-BENCHMARK(terrain_deform);
+BENCHMARK(terrainFindPoint);
+BENCHMARK(terrainWalk);
+BENCHMARK(terrainWalkBoundary);
+BENCHMARK(terrainDeform);
BENCHMARK_MAIN();