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

Method RunTest

Source/URLabEditor/Private/Tests/MjActuatorTests.cpp:44–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42 EAutomationTestFlags::EditorContext | EAutomationTestFlags::ProductFilter)
43
44bool FMjActuatorMotorActuatorBinds::RunTest(const FString& Parameters)
45{
46 UMjMotorActuator* Actuator = nullptr;
47
48 FMjUESession S;
49 if (!S.Init([&Actuator](FMjUESession& Sess) {
50 Sess.Joint->Type = EMjJointType::Hinge;
51 Sess.Joint->bOverride_Type = true;
52
53 Actuator = NewObject<UMjMotorActuator>(Sess.Robot, TEXT("TestActuator"));
54 Actuator->TargetName = TEXT("TestJoint");
55 Actuator->RegisterComponent();
56 }))
57 {
58 AddError(FString::Printf(TEXT("FMjUESession::Init failed: %s"), *S.LastError));
59 S.Cleanup();
60 return false;
61 }
62
63 TestNotNull(TEXT("Actuator should not be null after Init"), Actuator);
64 if (Actuator)
65 {
66 TestTrue(TEXT("Actuator->m_ActuatorView.id should be >= 0 after Bind()"),
67 Actuator->m_ActuatorView.id >= 0);
68 }
69
70 TestEqual(TEXT("Manager->PhysicsEngine->m_model->nu should be 1"),
71 (int)S.Manager->PhysicsEngine->m_model->nu, 1);
72
73 S.Cleanup();
74 return true;
75}
76
77// ============================================================================
78// URLab.Actuator.MotorActuator_SetControl

Callers

nothing calls this directly

Calls 6

SetControlMethod · 0.80
GetControlMethod · 0.80
GetForceMethod · 0.80
InitMethod · 0.45
CleanupMethod · 0.45
StepMethod · 0.45

Tested by

no test coverage detected