Skip to content

Commit

Permalink
port: 7 to 8 2022-11-16 (#310)
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Carroll <michael@openrobotics.org>
  • Loading branch information
mjcarroll authored Nov 17, 2022
2 parents bae3afe + 7dc6042 commit 82daf44
Show file tree
Hide file tree
Showing 8 changed files with 104 additions and 71 deletions.
22 changes: 22 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,28 @@
1. Fixed test - Download world 2
* [Pull request 110](https://github.com/gazebosim/gz-fuel-tools/pull/110)

## Gazebo Fuel Tools 4.x

### Gazebo Fuel Tools 4.6.0 (2022-08-15)

. Ignition to Gazebo server rename
* [Pull request #263](https://github.com/gazebosim/gz-fuel-tools/pull/263)

1. Remove redundant namespace references
* [Pull request #284](https://github.com/gazebosim/gz-fuel-tools/pull/284)

1. Change `IGN_DESIGNATION` to `GZ_DESIGNATION`
* [Pull request #278](https://github.com/gazebosim/gz-fuel-tools/pull/278)

1. Ignition -> Gazebo
* [Pull request #276](https://github.com/gazebosim/gz-fuel-tools/pull/276)

1. Remove unused files (bitbucket-pipelines, docs)
* [Pull request #273](https://github.com/gazebosim/gz-fuel-tools/pull/273)

1. Disable `staging-fuel.ignitionrobotics.org` test
* [Pull request #257](https://github.com/gazebosim/gz-fuel-tools/pull/257)

### Gazebo Fuel Tools 4.5.0 (2022-06-01)

1. APIs for retrieving models in parallel
Expand Down
5 changes: 5 additions & 0 deletions include/gz/fuel_tools/Interface.hh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
*
*/

#ifndef GZ_FUEL_TOOLS_INTERFACE_HH_
#define GZ_FUEL_TOOLS_INTERFACE_HH_

#include <string>
#include "gz/fuel_tools/Export.hh"
#include "gz/fuel_tools/FuelClient.hh"
Expand Down Expand Up @@ -60,3 +63,5 @@ namespace gz
const std::string &_path);
}
}

#endif
9 changes: 9 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,15 @@ gz_build_tests(TYPE UNIT
TINYXML2::TINYXML2
)

# Some tests download simulation assets, which can take longer than the
# default time limit.
if (TARGET UNIT_gz_src_TEST)
set_tests_properties(UNIT_gz_src_TEST PROPERTIES TIMEOUT 1000)
endif()
if (TARGET UNIT_FuelClient_TEST)
set_tests_properties(UNIT_FuelClient_TEST PROPERTIES TIMEOUT 1000)
endif()

foreach(test ${test_targets})

target_compile_definitions(${test} PRIVATE
Expand Down
34 changes: 15 additions & 19 deletions src/FuelClient.cc
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@ ModelIter FuelClient::Models(const ModelIdentifier &_id) const
path = path / _id.Owner() / "models";

if (path.Str().empty())
// cppcheck-suppress identicalConditionAfterEarlyExit
return localIter;

gzmsg << _id.UniqueName() << " not found in cache, attempting download\n";
Expand Down Expand Up @@ -778,15 +779,10 @@ Result FuelClient::ModelDependencies(
std::vector<ModelIdentifier> recursiveDeps;
this->ModelDependencies(modelDeps, recursiveDeps);

for (auto dep : modelDeps)
{
newDeps.push_back(dep);
}

for (auto dep : recursiveDeps)
{
newDeps.push_back(dep);
}
std::copy(modelDeps.begin(), modelDeps.end(),
std::back_inserter(newDeps));
std::copy(recursiveDeps.begin(), recursiveDeps.end(),
std::back_inserter(newDeps));
}
}

Expand Down Expand Up @@ -1078,8 +1074,8 @@ bool FuelClient::ParseModelUrl(const common::URI &_modelUrl,
_id.Server().SetVersion(apiVersion);
for (const auto &s : this->dataPtr->config.Servers())
{
if (s.Url().Str() == _id.Server().Url().Str())
{
// cppcheck-suppress useStlAlgorithm
if (s.Url().Str() == _id.Server().Url().Str()) {
if (!apiVersion.empty() && s.Version() != _id.Server().Version())
{
gzwarn << "Requested server API version [" << apiVersion
Expand Down Expand Up @@ -1144,8 +1140,8 @@ bool FuelClient::ParseWorldUrl(const common::URI &_worldUrl,
_id.Server().SetVersion(apiVersion);
for (const auto &s : this->dataPtr->config.Servers())
{
if (s.Url() == _id.Server().Url())
{
// cppcheck-suppress useStlAlgorithm
if (s.Url() == _id.Server().Url()) {
if (!apiVersion.empty() && s.Version() != _id.Server().Version())
{
gzwarn << "Requested server API version [" << apiVersion
Expand Down Expand Up @@ -1212,8 +1208,8 @@ bool FuelClient::ParseModelFileUrl(const common::URI &_fileUrl,
_id.Server().SetVersion(apiVersion);
for (const auto &s : this->dataPtr->config.Servers())
{
if (s.Url().Str() == _id.Server().Url().Str())
{
// cppcheck-suppress useStlAlgorithm
if (s.Url().Str() == _id.Server().Url().Str()) {
if (!apiVersion.empty() && s.Version() != _id.Server().Version())
{
gzwarn << "Requested server API version [" << apiVersion
Expand Down Expand Up @@ -1281,8 +1277,8 @@ bool FuelClient::ParseWorldFileUrl(const common::URI &_fileUrl,
_id.Server().SetVersion(apiVersion);
for (const auto &s : this->dataPtr->config.Servers())
{
if (s.Url() == _id.Server().Url())
{
// cppcheck-suppress useStlAlgorithm
if (s.Url() == _id.Server().Url()) {
if (!apiVersion.empty() && s.Version() != _id.Server().Version())
{
gzwarn << "Requested server API version [" << apiVersion
Expand Down Expand Up @@ -1348,8 +1344,8 @@ bool FuelClient::ParseCollectionUrl(const common::URI &_url,
_id.Server().SetVersion(apiVersion);
for (const auto &s : this->dataPtr->config.Servers())
{
if (s.Url() == _id.Server().Url())
{
// cppcheck-suppress useStlAlgorithm
if (s.Url() == _id.Server().Url()) {
if (!apiVersion.empty() && s.Version() != _id.Server().Version())
{
gzwarn << "Requested server API version [" << apiVersion
Expand Down
1 change: 1 addition & 0 deletions src/RestClient.cc
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ RestResponse Rest::Request(HttpMethod _method,
{
std::string fullQuery{"?"};
for (const std::string &queryString : _queryStrings)
// cppcheck-suppress useStlAlgorithm
fullQuery += queryString + "&";

fullQuery.pop_back();
Expand Down
4 changes: 2 additions & 2 deletions src/WorldIter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ WorldIterRestIds::WorldIterRestIds(const Rest &_rest,
resp.headers["Link"], ",");
for (const auto &l : links)
{
if (l.find("next") != std::string::npos)
{
// cppcheck-suppress useStlAlgorithm
if (l.find("next") != std::string::npos) {
auto start = l.find(queryStrPageKey);
auto end = l.find(">", start+1);
queryStrPage = l.substr(start, end-start);
Expand Down
2 changes: 1 addition & 1 deletion src/Zip.cc
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ bool Zip::Extract(const std::string &_src,
char *buf = new char[readSize];
int len = zip_fread(zf, buf, readSize);

if (len < 0)
if (len <= 0)
gzerr << "Error reading " << sb.name << std::endl;
else
{
Expand Down
Loading

0 comments on commit 82daf44

Please sign in to comment.