Tesseract
Motion Planning Environment
|
#include <tesseract_common/macros.h>
#include <gtest/gtest.h>
#include <iostream>
#include <fstream>
#include <tesseract_support/tesseract_support_resource_locator.h>
#include <tesseract_common/types.h>
#include <tesseract_common/unit_test_utils.h>
Functions | |
tesseract_common::fs::path | file_path (INSTALL_LOCATION) |
EXPECT_TRUE (resource !=nullptr) | |
EXPECT_TRUE (resource->isFile()) | |
EXPECT_EQ (resource->getUrl(), "package://tesseract_support/urdf/abb_irb2400.urdf") | |
EXPECT_EQ (tesseract_common::fs::path(resource->getFilePath()),(package_path/"urdf/abb_irb2400.urdf")) | |
EXPECT_FALSE (resource->getResourceContents().empty()) | |
EXPECT_TRUE (resource->getResourceContentStream() !=nullptr) | |
EXPECT_TRUE (sub_resource !=nullptr) | |
EXPECT_TRUE (sub_resource->isFile()) | |
EXPECT_EQ (sub_resource->getUrl(), "package://tesseract_support/urdf/boxbot.urdf") | |
EXPECT_EQ (tesseract_common::fs::path(sub_resource->getFilePath()),(package_path/"urdf/boxbot.urdf")) | |
EXPECT_FALSE (sub_resource->getResourceContents().empty()) | |
EXPECT_TRUE (sub_resource->getResourceContentStream() !=nullptr) | |
EXPECT_TRUE (resource_empty==nullptr) | |
EXPECT_TRUE (resource_does_not_exist !=nullptr) | |
EXPECT_TRUE (resource_does_not_exist->getResourceContents().empty()) | |
EXPECT_TRUE (resource_does_not_exist->getResourceContentStream()==nullptr) | |
int | main (int argc, char **argv) |
Variables | |
TESSERACT_COMMON_IGNORE_WARNINGS_PUSH | TESSERACT_COMMON_IGNORE_WARNINGS_POP |
tesseract_common::fs::path | package_path = file_path / "share/tesseract_support" |
ResourceLocator::Ptr | locator = std::make_shared<TesseractSupportResourceLocator>() |
Resource::Ptr | resource = locator->locateResource("package://tesseract_support/urdf/abb_irb2400.urdf") |
Resource::Ptr | sub_resource = resource->locateResource("boxbot.urdf") |
tesseract_common::Resource::Ptr | resource_empty = locator->locateResource("") |
tesseract_common::Resource::Ptr | resource_does_not_exist |
EXPECT_EQ | ( | resource-> | getUrl(), |
"package://tesseract_support/urdf/abb_irb2400.urdf" | |||
) |
EXPECT_EQ | ( | sub_resource-> | getUrl(), |
"package://tesseract_support/urdf/boxbot.urdf" | |||
) |
EXPECT_EQ | ( | tesseract_common::fs::path(resource->getFilePath()) | , |
(package_path/"urdf/abb_irb2400.urdf") | |||
) |
EXPECT_EQ | ( | tesseract_common::fs::path(sub_resource->getFilePath()) | , |
(package_path/"urdf/boxbot.urdf") | |||
) |
EXPECT_FALSE | ( | resource-> | getResourceContents).empty( | ) |
EXPECT_FALSE | ( | sub_resource-> | getResourceContents).empty( | ) |
EXPECT_TRUE | ( | resource ! | = nullptr | ) |
EXPECT_TRUE | ( | resource->getResourceContentStream() ! | = nullptr | ) |
EXPECT_TRUE | ( | resource-> | isFile() | ) |
EXPECT_TRUE | ( | resource_does_not_exist ! | = nullptr | ) |
EXPECT_TRUE | ( | resource_does_not_exist-> | getResourceContents).empty( | ) |
EXPECT_TRUE | ( | resource_does_not_exist-> | getResourceContentStream() = =nullptr | ) |
EXPECT_TRUE | ( | resource_empty | = =nullptr | ) |
EXPECT_TRUE | ( | sub_resource ! | = nullptr | ) |
EXPECT_TRUE | ( | sub_resource->getResourceContentStream() ! | = nullptr | ) |
EXPECT_TRUE | ( | sub_resource-> | isFile() | ) |
tesseract_common::fs::path file_path | ( | INSTALL_LOCATION | ) |
int main | ( | int | argc, |
char ** | argv | ||
) |
ResourceLocator::Ptr locator = std::make_shared<TesseractSupportResourceLocator>() |
tesseract_common::fs::path package_path = file_path / "share/tesseract_support" |
Resource::Ptr resource = locator->locateResource("package://tesseract_support/urdf/abb_irb2400.urdf") |
tesseract_common::Resource::Ptr resource_does_not_exist |
tesseract_common::Resource::Ptr resource_empty = locator->locateResource("") |
Resource::Ptr sub_resource = resource->locateResource("boxbot.urdf") |
TESSERACT_COMMON_IGNORE_WARNINGS_PUSH TESSERACT_COMMON_IGNORE_WARNINGS_POP |