mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-10 06:39:49 +00:00
Fix LuaUtilPackageTest.Transform
It can fail due to float arithmetic precision with error: Expected equality of these values: getAsString(lua, "moveAndScale") Which is: "TransformM{ move(6, 22, 18) scale(0.5, 1, 0.5) rotation(angle=8.53284e-17, axis=(1, 0, 0)) }" "TransformM{ move(6, 22, 18) scale(0.5, 1, 0.5) }"
This commit is contained in:
parent
d8d16a52e1
commit
23026caacc
@ -91,7 +91,7 @@ namespace
|
||||
lua.safe_script("moveAndScale = T.move(v(1, 2, 3)) * T.scale(0.5, 1, 0.5) * T.move(10, 20, 30)");
|
||||
EXPECT_EQ(getAsString(lua, "moveAndScale * v(0, 0, 0)"), "(6, 22, 18)");
|
||||
EXPECT_EQ(getAsString(lua, "moveAndScale * v(300, 200, 100)"), "(156, 222, 68)");
|
||||
EXPECT_EQ(getAsString(lua, "moveAndScale"), "TransformM{ move(6, 22, 18) scale(0.5, 1, 0.5) }");
|
||||
EXPECT_THAT(getAsString(lua, "moveAndScale"), AllOf(StartsWith("TransformM{ move(6, 22, 18) scale(0.5, 1, 0.5) "), EndsWith(" }")));
|
||||
EXPECT_EQ(getAsString(lua, "T.identity"), "TransformM{ }");
|
||||
lua.safe_script("rx = T.rotateX(math.pi / 2)");
|
||||
lua.safe_script("ry = T.rotateY(math.pi / 2)");
|
||||
|
Loading…
Reference in New Issue
Block a user