[Scummvm-git-logs] scummvm master -> 888f1c615440f4a2f61aacb47094434d40cf372d
OMGPizzaGuy
noreply at scummvm.org
Sat Sep 23 04:59:33 UTC 2023
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
888f1c6154 ULTIMA8: Fix tests for sort item to use bounds that properly overlap
Commit: 888f1c615440f4a2f61aacb47094434d40cf372d
https://github.com/scummvm/scummvm/commit/888f1c615440f4a2f61aacb47094434d40cf372d
Author: Matthew Jimenez (matthew.jimenez at outlook.com)
Date: 2023-09-22T23:57:36-05:00
Commit Message:
ULTIMA8: Fix tests for sort item to use bounds that properly overlap
Changed paths:
test/engines/ultima/ultima8/world/sort_item.h
diff --git a/test/engines/ultima/ultima8/world/sort_item.h b/test/engines/ultima/ultima8/world/sort_item.h
index a33ad13ca89..120ba39a558 100644
--- a/test/engines/ultima/ultima8/world/sort_item.h
+++ b/test/engines/ultima/ultima8/world/sort_item.h
@@ -17,11 +17,14 @@ class U8SortItemTestSuite : public CxxTest::TestSuite {
Ultima::Ultima8::SortItem si1;
Ultima::Ultima8::SortItem si2;
- Ultima::Ultima8::Box b1(0, 10, 0, 10, 10, 0);
- Ultima::Ultima8::Box b2(0, 30, 0, 10, 10, 0);
+ Ultima::Ultima8::Box b1(0, 10, 0, 10, 10, 10);
+ Ultima::Ultima8::Box b2(0, 20, 0, 10, 10, 10);
si1.setBoxBounds(b1, 0, 0);
si2.setBoxBounds(b2, 0, 0);
+ TS_ASSERT(si1.overlap(si2));
+ TS_ASSERT(si2.overlap(si1));
+
TS_ASSERT(si1.below(si2));
TS_ASSERT(!si2.below(si1));
}
@@ -31,11 +34,14 @@ class U8SortItemTestSuite : public CxxTest::TestSuite {
Ultima::Ultima8::SortItem si1;
Ultima::Ultima8::SortItem si2;
- Ultima::Ultima8::Box b1(10, 0, 0, 10, 10, 0);
- Ultima::Ultima8::Box b2(30, 0, 0, 10, 10, 0);
+ Ultima::Ultima8::Box b1(10, 0, 0, 10, 10, 10);
+ Ultima::Ultima8::Box b2(20, 0, 0, 10, 10, 10);
si1.setBoxBounds(b1, 0, 0);
si2.setBoxBounds(b2, 0, 0);
+ TS_ASSERT(si1.overlap(si2));
+ TS_ASSERT(si2.overlap(si1));
+
TS_ASSERT(si1.below(si2));
TS_ASSERT(!si2.below(si1));
}
@@ -46,10 +52,13 @@ class U8SortItemTestSuite : public CxxTest::TestSuite {
Ultima::Ultima8::SortItem si2;
Ultima::Ultima8::Box b1(10, 10, 0, 10, 10, 10);
- Ultima::Ultima8::Box b2(10, 10, 20, 10, 10, 10);
+ Ultima::Ultima8::Box b2(10, 10, 10, 10, 10, 10);
si1.setBoxBounds(b1, 0, 0);
si2.setBoxBounds(b2, 0, 0);
+ TS_ASSERT(si1.overlap(si2));
+ TS_ASSERT(si2.overlap(si1));
+
TS_ASSERT(si1.below(si2));
TS_ASSERT(!si2.below(si1));
}
@@ -354,15 +363,18 @@ class U8SortItemTestSuite : public CxxTest::TestSuite {
Ultima::Ultima8::SortItem si1;
Ultima::Ultima8::SortItem si2;
- Ultima::Ultima8::Box b1(129, 32, 0, 64, 64, 24);
+ Ultima::Ultima8::Box b1(7839, 19839, 24, 64, 64, 24);
si1.setBoxBounds(b1, 0, 0);
si1._anim = true;
si1._solid = true;
- Ultima::Ultima8::Box b2(64, 69, 24, 64, 64, 40);
+ Ultima::Ultima8::Box b2(7774, 19876, 48, 64, 64, 40);
si2.setBoxBounds(b2, 0, 0);
si2._solid = true;
+ TS_ASSERT(si1.overlap(si2));
+ TS_ASSERT(si2.overlap(si1));
+
TS_ASSERT(si1.below(si2));
TS_ASSERT(!si2.below(si1));
}
More information about the Scummvm-git-logs
mailing list