Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unused warnings in filesystem tests #1841

Merged
merged 1 commit into from
Jul 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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