MCPcopy Create free account
hub / github.com/URLab-Sim/UnrealRoboticsLab / RunTest

Method RunTest

Source/URLabEditor/Private/Tests/MjImportTests.cpp:71–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69
70IMPLEMENT_SIMPLE_AUTOMATION_TEST(FTest_MjImport_MJ_BodyPos,
71 "URLab.Import.MJ_BodyPos",
72 EAutomationTestFlags::EditorContext | EAutomationTestFlags::ProductFilter)
73bool FTest_MjImport_MJ_BodyPos::RunTest(const FString&)
74{
75 FMjTestSession S;
76 if (!S.CompileXml(TEXT(R"(
77 <mujoco>
78 <worldbody>
79 <body name="b1" pos="1 2 3">
80 <geom size=".1"/>
81 </body>
82 </worldbody>
83 </mujoco>
84 )")))
85 {
86 AddError(S.LastError);
87 return false;
88 }
89
90 int bid = S.BodyId("b1");
91 TestTrue(TEXT("b1 body id valid"), bid >= 0);
92 TestNearlyEqual(TEXT("b1 x"), (float)S.m->body_pos[3 * bid + 0], 1.0f, 1e-4f);
93 TestNearlyEqual(TEXT("b1 y"), (float)S.m->body_pos[3 * bid + 1], 2.0f, 1e-4f);
94 TestNearlyEqual(TEXT("b1 z"), (float)S.m->body_pos[3 * bid + 2], 3.0f, 1e-4f);
95 S.Cleanup();
96 return true;
97}
98

Callers

nothing calls this directly

Calls 9

CompileXmlMethod · 0.80
BodyIdMethod · 0.80
GeomIdMethod · 0.80
JointIdMethod · 0.80
ModelMethod · 0.80
CleanupMethod · 0.45
InitMethod · 0.45
CompileMethod · 0.45
ExportToMethod · 0.45

Tested by

no test coverage detected