本文整理汇总了C++中Joint::getLength方法的典型用法代码示例。如果您正苦于以下问题:C++ Joint::getLength方法的具体用法?C++ Joint::getLength怎么用?C++ Joint::getLength使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Joint
的用法示例。
在下文中一共展示了Joint::getLength方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: normalConstruction
/* normal construction test */
void JointTest::normalConstruction() {
int id = 1;
std::string name = "test";
float mass = 2;
float length = 3;
using namespace RoboticArm;
Joint createdPart = Joint(id, name, mass, length);
if (createdPart.getId() == id && createdPart.getName() == name &&
createdPart.getLength() == length && createdPart.getMass() == mass) {
CPPUNIT_ASSERT(true);
} else {
CPPUNIT_ASSERT(false);
}
}
示例2: validParReadBack
void JointTest::validParReadBack(){
bool success = true;
int id = 111;
std::string name = "test";
float mass = 123.54566;
float length = 14676.54;
using namespace RoboticArm;
try {
Joint createdPart = Joint(id, name, mass, length);
if (id != createdPart.getId()) {
std::cout << "ID is wrong." << std::endl;
success = false;
}
if (name != createdPart.getName()) {
std::cout << "Name is wrong." << std::endl;
success = false;
}
if (mass != createdPart.getMass()) {
std::cout << "Mass is wrong." << std::endl;
success = false;
}
if (length != createdPart.getLength()) {
std::cout << "Length is wrong." << std::endl;
success = false;
}
} catch (const std::invalid_argument& ia) {
success = false;
}
CPPUNIT_ASSERT(success);
}