Skip to content

Commit

Permalink
Fix unused warnings in filesystem tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasVautherin committed Jul 7, 2022
1 parent 24f101d commit 6f400ee
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/mavsdk/core/fs_test.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include <gtest/gtest.h>

#include "fs.h"
#include "unused.h"

#if !defined(WINDOWS)
#define PATH_MAX 4096
Expand Down Expand Up @@ -43,7 +45,7 @@ TEST(Filesystem, ResolveDoubleDots)
TEST(Filesystem, RelativePathEmpty)
{
char cwd[PATH_MAX];
getcwd(cwd, PATH_MAX);
UNUSED(getcwd(cwd, PATH_MAX));
const std::string path = "";
const std::string canonical_path = std::string(cwd);
ASSERT_EQ(canonical_path, mavsdk::fs_canonical(path));
Expand All @@ -52,7 +54,7 @@ TEST(Filesystem, RelativePathEmpty)
TEST(Filesystem, RelativePathDot)
{
char cwd[PATH_MAX];
getcwd(cwd, PATH_MAX);
UNUSED(getcwd(cwd, PATH_MAX));
const std::string path = ".";
const std::string canonical_path = std::string(cwd);
ASSERT_EQ(canonical_path, mavsdk::fs_canonical(path));
Expand All @@ -61,7 +63,7 @@ TEST(Filesystem, RelativePathDot)
TEST(Filesystem, RelativePathBare)
{
char cwd[PATH_MAX];
getcwd(cwd, PATH_MAX);
UNUSED(getcwd(cwd, PATH_MAX));
const std::string path = "src/mavsdk/core/fs_test.cpp";
const std::string canonical_path = std::string(cwd) + mavsdk::path_separator + path;
ASSERT_EQ(canonical_path, mavsdk::fs_canonical(path));
Expand All @@ -70,7 +72,7 @@ TEST(Filesystem, RelativePathBare)
TEST(Filesystem, RelativePathDotSlash)
{
char cwd[PATH_MAX];
getcwd(cwd, PATH_MAX);
UNUSED(getcwd(cwd, PATH_MAX));
const std::string bare_path = "src/mavsdk/plugins/mavlink_passthrough";
const std::string dotslash_path = "./" + bare_path;
const std::string canonical_path = std::string(cwd) + mavsdk::path_separator + bare_path;
Expand Down

0 comments on commit 6f400ee

Please sign in to comment.