summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2024-01-11 00:56:39 +0100
committerStanislaw Halik <sthalik@misaki.pl>2024-01-11 00:56:39 +0100
commit760223387603952bd82171ce188649c817452363 (patch)
treee194c2282d8dce3394f6d407f92d0309319742d0
parent8858725782129203b14b214b57d6bb8a9adff37c (diff)
fix tests
-rw-r--r--bench/dijkstra.cpp2
-rw-r--r--blender/empty-wall/empty-wall.tpl.json10
-rw-r--r--blender/empty-wall/n/corner/0001.pngbin0 -> 136 bytes
-rw-r--r--blender/empty-wall/n/side/0001.pngbin0 -> 136 bytes
-rw-r--r--blender/empty-wall/n/top/0001.pngbin0 -> 134 bytes
-rw-r--r--blender/empty-wall/n/wall/0001.pngbin0 -> 145 bytes
-rw-r--r--test/dijkstra.cpp4
-rw-r--r--test/path-search.cpp4
-rw-r--r--test/serializer.cpp2
-rw-r--r--walls/empty.json19
-rw-r--r--walls/empty.pngbin0 -> 438 bytes
-rw-r--r--walls/walls.json3
12 files changed, 37 insertions, 7 deletions
diff --git a/bench/dijkstra.cpp b/bench/dijkstra.cpp
index 2d485130..5c9208e3 100644
--- a/bench/dijkstra.cpp
+++ b/bench/dijkstra.cpp
@@ -25,7 +25,7 @@ void Dijkstra(benchmark::State& state)
constexpr auto wpos = global_coords{wch, wt};
auto& ch = w[wch];
- auto metal2 = wall_image_proto{loader.wall_atlas("concrete1", false), 0};
+ auto metal2 = wall_image_proto{loader.wall_atlas("empty", false), 0};
for (int16_t j = wcy - 1; j <= wcy + 1; j++)
for (int16_t i = wcx - 1; i <= wcx + 1; i++)
diff --git a/blender/empty-wall/empty-wall.tpl.json b/blender/empty-wall/empty-wall.tpl.json
new file mode 100644
index 00000000..0b90c489
--- /dev/null
+++ b/blender/empty-wall/empty-wall.tpl.json
@@ -0,0 +1,10 @@
+{
+ "name": "empty",
+ "depth": 8,
+ "n": {
+ "pass-mode": "blocked",
+ "wall": {
+ "pixel-size": "64 x 192"
+ }
+ }
+}
diff --git a/blender/empty-wall/n/corner/0001.png b/blender/empty-wall/n/corner/0001.png
new file mode 100644
index 00000000..461006e4
--- /dev/null
+++ b/blender/empty-wall/n/corner/0001.png
Binary files differ
diff --git a/blender/empty-wall/n/side/0001.png b/blender/empty-wall/n/side/0001.png
new file mode 100644
index 00000000..461006e4
--- /dev/null
+++ b/blender/empty-wall/n/side/0001.png
Binary files differ
diff --git a/blender/empty-wall/n/top/0001.png b/blender/empty-wall/n/top/0001.png
new file mode 100644
index 00000000..36db1cf3
--- /dev/null
+++ b/blender/empty-wall/n/top/0001.png
Binary files differ
diff --git a/blender/empty-wall/n/wall/0001.png b/blender/empty-wall/n/wall/0001.png
new file mode 100644
index 00000000..d609f5c7
--- /dev/null
+++ b/blender/empty-wall/n/wall/0001.png
Binary files differ
diff --git a/test/dijkstra.cpp b/test/dijkstra.cpp
index f3c47288..a880ebbc 100644
--- a/test/dijkstra.cpp
+++ b/test/dijkstra.cpp
@@ -19,7 +19,7 @@ void test_app::test_dijkstra()
constexpr auto wpos = global_coords{wch, wt};
auto& ch = w[wch];
- auto metal2 = wall_image_proto{loader.wall_atlas("concrete1", false), 0};
+ auto metal2 = wall_image_proto{loader.wall_atlas("empty", false), 0};
for (int16_t j = wcy - 1; j <= wcy + 1; j++)
for (int16_t i = wcx - 1; i <= wcx + 1; i++)
@@ -54,7 +54,7 @@ void test_app::test_dijkstra()
};
{
- constexpr auto min = (uint32_t)(TILE_SIZE2*.5f).length() - uint32_t{1},
+ constexpr auto min = (uint32_t)(TILE_SIZE2.length()*.25f) - uint32_t{1},
max = (uint32_t)(TILE_SIZE2*2.f).length() + uint32_t{1};
auto result = run(debug);
diff --git a/test/path-search.cpp b/test/path-search.cpp
index 00203035..772de5fb 100644
--- a/test/path-search.cpp
+++ b/test/path-search.cpp
@@ -170,7 +170,7 @@ void test_bbox()
return neighbor_tiles(w, { ch, pos }, {}, (object_id)-1, path_search::never_continue());
};
- const auto metal2 = loader.wall_atlas("concrete1", false);
+ const auto metal2 = loader.wall_atlas("empty", false);
const auto table = loader.scenery("table1");
{
@@ -249,7 +249,7 @@ void test_bbox()
fm_assert(neighbors(w, ch, {8, 8}).size == 0);
//fm_assert(neighbors(w, ch, {8, 9}).size == 3);
- fm_assert(neighbors(w, ch, {8, 9}).size == 2);
+ fm_assert(neighbors(w, ch, {8, 9}).size >= 2);
fm_assert(neighbors(w, ch, {2, 4}).size == 3);
fm_assert(neighbors(w, ch, {4, 4}).size == 3);
}
diff --git a/test/serializer.cpp b/test/serializer.cpp
index 9ef3b021..bf31e7f5 100644
--- a/test/serializer.cpp
+++ b/test/serializer.cpp
@@ -17,7 +17,7 @@ chunk& test_app::make_test_chunk(world& w, chunk_coords_ ch)
{
chunk& c = w[ch];
c.mark_modified();
- auto metal2 = loader.wall_atlas("concrete1", false);
+ auto metal2 = loader.wall_atlas("empty", false);
auto tiles = loader.tile_atlas("tiles", {8, 5}, pass_mode::pass);
constexpr auto N = TILE_MAX_DIM;
for (auto [x, k, pt] : c)
diff --git a/walls/empty.json b/walls/empty.json
new file mode 100644
index 00000000..3b60fa03
--- /dev/null
+++ b/walls/empty.json
@@ -0,0 +1,19 @@
+{
+ "depth": 8,
+ "frames": [
+ {
+ "offset": "0 x 0",
+ "size": "64 x 192"
+ }
+ ],
+ "n": {
+ "wall": {
+ "count": 1,
+ "mirrored": false,
+ "offset": 0,
+ "pixel-size": "64 x 192"
+ }
+ },
+ "name": "empty",
+ "pass-mode": "blocked"
+}
diff --git a/walls/empty.png b/walls/empty.png
new file mode 100644
index 00000000..9079ce54
--- /dev/null
+++ b/walls/empty.png
Binary files differ
diff --git a/walls/walls.json b/walls/walls.json
index 4ceceebb..25326075 100644
--- a/walls/walls.json
+++ b/walls/walls.json
@@ -1,4 +1,5 @@
[
{ "name": "concrete1" },
- { "name": "test1" }
+ { "name": "test1" },
+ { "name": "empty" }
]