Skip to content

Commit

Permalink
Add nested model to error messages, update tests
Browse files Browse the repository at this point in the history
Signed-off-by: Steve Peters <[email protected]>
  • Loading branch information
scpeters committed Jul 24, 2020
1 parent 384c759 commit 7353fac
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
8 changes: 4 additions & 4 deletions src/FrameSemantics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ Errors buildFrameAttachedToGraph(
errors.push_back({ErrorCode::FRAME_ATTACHED_TO_INVALID,
"attached_to name[" + attachedTo +
"] specified by frame with name[" + frame->Name() +
"] does not match a link, joint, or frame name "
"] does not match a nested model, link, joint, or frame name "
"in model with name[" + _model->Name() + "]."});
continue;
}
Expand Down Expand Up @@ -600,7 +600,7 @@ Errors buildPoseRelativeToGraph(
errors.push_back({ErrorCode::POSE_RELATIVE_TO_INVALID,
"relative_to name[" + relativeTo +
"] specified by link with name[" + link->Name() +
"] does not match a link, joint, or frame name "
"] does not match a nested model, link, joint, or frame name "
"in model with name[" + _model->Name() + "]."});
continue;
}
Expand Down Expand Up @@ -635,7 +635,7 @@ Errors buildPoseRelativeToGraph(
errors.push_back({ErrorCode::POSE_RELATIVE_TO_INVALID,
"relative_to name[" + relativeTo +
"] specified by joint with name[" + joint->Name() +
"] does not match a link, joint, or frame name "
"] does not match a nested model, link, joint, or frame name "
"in model with name[" + _model->Name() + "]."});
continue;
}
Expand Down Expand Up @@ -684,7 +684,7 @@ Errors buildPoseRelativeToGraph(
errors.push_back({errorCode,
typeForErrorMsg + " name[" + relativeTo +
"] specified by frame with name[" + frame->Name() +
"] does not match a link, joint, or frame name "
"] does not match a nested model, link, joint, or frame name "
"in model with name[" + _model->Name() + "]."});
continue;
}
Expand Down
16 changes: 8 additions & 8 deletions src/ign_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,8 @@ TEST(check, SDF)
std::string output =
custom_exec_str(g_ignCommand + " sdf -k " + path + g_sdfVersion);
EXPECT_NE(output.find("Error: attached_to name[A] specified by frame with "
"name[F3] does not match a link, joint, or frame "
"name in model with "
"name[F3] does not match a nested model, link, "
"joint, or frame name in model with "
"name[model_frame_invalid_attached_to]."),
std::string::npos) << output;
EXPECT_NE(output.find("Error: attached_to name[F4] is identical to frame "
Expand Down Expand Up @@ -455,8 +455,8 @@ TEST(check, SDF)
std::string output =
custom_exec_str(g_ignCommand + " sdf -k " + path + g_sdfVersion);
EXPECT_NE(output.find("Error: relative_to name[A] specified by link with "
"name[L] does not match a link, joint, or frame "
"name in model with "
"name[L] does not match a nested model, link, "
"joint, or frame name in model with "
"name[model_invalid_link_relative_to]."),
std::string::npos) << output;
EXPECT_NE(output.find("Error: relative_to name[self_cycle] is identical to "
Expand Down Expand Up @@ -495,8 +495,8 @@ TEST(check, SDF)
std::string output =
custom_exec_str(g_ignCommand + " sdf -k " + path + g_sdfVersion);
EXPECT_NE(output.find("Error: relative_to name[A] specified by joint with "
"name[J] does not match a link, joint, or frame "
"name in model with "
"name[J] does not match a nested model, link, "
"joint, or frame name in model with "
"name[model_invalid_joint_relative_to]."),
std::string::npos) << output;
EXPECT_NE(output.find("Error: relative_to name[Jcycle] is identical to "
Expand Down Expand Up @@ -535,8 +535,8 @@ TEST(check, SDF)
std::string output =
custom_exec_str(g_ignCommand + " sdf -k " + path + g_sdfVersion);
EXPECT_NE(output.find("Error: relative_to name[A] specified by frame with "
"name[F] does not match a link, joint, or frame "
"name in model with "
"name[F] does not match a nested model, link, "
"joint, or frame name in model with "
"name[model_invalid_frame_relative_to]."),
std::string::npos) << output;
EXPECT_NE(output.find("Error: relative_to name[cycle] is identical to "
Expand Down
6 changes: 3 additions & 3 deletions test/integration/frame.cc
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ TEST(DOMFrame, LoadModelFramesInvalidAttachedTo)
EXPECT_NE(std::string::npos,
errors[0].Message().find(
"attached_to name[A] specified by frame with name[F3] does not match a "
"link, joint, or frame name in model"));
"nested model, link, joint, or frame name in model"));
EXPECT_EQ(errors[1].Code(), sdf::ErrorCode::FRAME_ATTACHED_TO_CYCLE);
EXPECT_NE(std::string::npos,
errors[1].Message().find(
Expand All @@ -502,7 +502,7 @@ TEST(DOMFrame, LoadModelFramesInvalidAttachedTo)
EXPECT_NE(std::string::npos,
errors[5].Message().find(
"attached_to name[A] specified by frame with name[F3] does not match a "
"link, joint, or frame name in model"));
"nested model, link, joint, or frame name in model"));
EXPECT_EQ(errors[6].Code(), sdf::ErrorCode::POSE_RELATIVE_TO_CYCLE);
EXPECT_NE(std::string::npos,
errors[6].Message().find(
Expand Down Expand Up @@ -886,7 +886,7 @@ TEST(DOMFrame, LoadModelFramesInvalidRelativeTo)
EXPECT_NE(std::string::npos,
errors[0].Message().find(
"relative_to name[A] specified by frame with name[F] does not match a "
"link, joint, or frame name in model"));
"nested model, link, joint, or frame name in model"));
EXPECT_EQ(errors[1].Code(), sdf::ErrorCode::POSE_RELATIVE_TO_CYCLE);
EXPECT_NE(std::string::npos,
errors[1].Message().find(
Expand Down
2 changes: 1 addition & 1 deletion test/integration/joint_dom.cc
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ TEST(DOMJoint, LoadInvalidJointPoseRelativeTo)
EXPECT_NE(std::string::npos,
errors[1].Message().find(
"relative_to name[A] specified by joint with name[J] does not match a "
"link, joint, or frame name in model"));
"nested model, link, joint, or frame name in model"));
// errors[2]
// errors[3]
// errors[4]
Expand Down
2 changes: 1 addition & 1 deletion test/integration/link_dom.cc
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ TEST(DOMLink, LoadInvalidLinkPoseRelativeTo)
EXPECT_NE(std::string::npos,
errors[0].Message().find(
"relative_to name[A] specified by link with name[L] does not match a "
"link, joint, or frame name in model"));
"nested model, link, joint, or frame name in model"));
EXPECT_EQ(errors[1].Code(), sdf::ErrorCode::POSE_RELATIVE_TO_CYCLE);
EXPECT_NE(std::string::npos,
errors[1].Message().find(
Expand Down

0 comments on commit 7353fac

Please sign in to comment.