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

Method RunTest

Source/URLabEditor/Private/Tests/MjMuscleTests.cpp:182–222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

180 "URLab.Muscle.Arm26_Counts",
181 EAutomationTestFlags::EditorContext | EAutomationTestFlags::ProductFilter)
182bool FTest_MjMuscle_Arm26_Counts::RunTest(const FString&)
183{
184 FMjTestSession Ref;
185 if (!Ref.CompileXml(ARM26_XML))
186 {
187 AddError(Ref.LastError);
188 return false;
189 }
190
191 FMjXmlImportSession S;
192 if (!S.Init(ARM26_XML))
193 {
194 AddError(S.LastError);
195 Ref.Cleanup();
196 return false;
197 }
198
199 // Pre-compile diagnostic: how many component templates did the importer create?
200 AddInfo(FString::Printf(TEXT("templates: UMjMuscleActuator=%d, UMjTendon=%d, UMjSite=%d"),
201 S.CountTemplates<class UMjMuscleActuator>(),
202 S.CountTemplates<class UMjTendon>(),
203 S.CountTemplates<class UMjSite>()));
204
205 if (!S.Compile())
206 {
207 AddError(S.LastError);
208 S.Cleanup();
209 Ref.Cleanup();
210 return false;
211 }
212
213 TestEqual(TEXT("nbody"), (int)S.Model()->nbody, (int)Ref.m->nbody);
214 TestEqual(TEXT("ngeom"), (int)S.Model()->ngeom, (int)Ref.m->ngeom);
215 TestEqual(TEXT("ntendon"), (int)S.Model()->ntendon, (int)Ref.m->ntendon);
216 TestEqual(TEXT("nu"), (int)S.Model()->nu, (int)Ref.m->nu);
217 TestEqual(TEXT("nsite"), (int)S.Model()->nsite, (int)Ref.m->nsite);
218
219 S.Cleanup();
220 Ref.Cleanup();
221 return true;
222}
223
224// For every muscle in arm26, verify dyntype / gaintype / biastype and the
225// full dynprm / gainprm / biasprm vectors match the native-parse reference

Callers

nothing calls this directly

Calls 6

ActuatorParamsMatchFunction · 0.85
CompileXmlMethod · 0.80
ModelMethod · 0.80
InitMethod · 0.45
CleanupMethod · 0.45
CompileMethod · 0.45

Tested by

no test coverage detected