Skip to content

Commit

Permalink
config.hpp.in: remove whitespace from version macros (dartsim#1820)
Browse files Browse the repository at this point in the history
Signed-off-by: Steve Peters <scpeters@openrobotics.org>
  • Loading branch information
scpeters authored and henriquealrs committed Jul 13, 2024
1 parent ff610d3 commit e11c65f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dart/config.hpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
#pragma once

/* Version number */
#define DART_MAJOR_VERSION @DART_MAJOR_VERSION @
#define DART_MINOR_VERSION @DART_MINOR_VERSION @
#define DART_PATCH_VERSION @DART_PATCH_VERSION @
#define DART_MAJOR_VERSION @DART_MAJOR_VERSION@
#define DART_MINOR_VERSION @DART_MINOR_VERSION@
#define DART_PATCH_VERSION @DART_PATCH_VERSION@

#define DART_VERSION "@DART_VERSION@"
#define DART_DESCRIPTION "@DART_PKG_DESC@"
Expand Down
12 changes: 12 additions & 0 deletions tests/unit/common/test_Logging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
#include "TestHelpers.hpp"

#include <dart/common/Logging.hpp>
// For version macros
#include <dart/config.hpp>

#include <gtest/gtest.h>

Expand All @@ -55,3 +57,13 @@ TEST(LoggingTest, Arguments)
[[maybe_unused]] int val = 10;
DART_INFO("Log with param '{}' and '{}'", 1, val);
}

//==============================================================================
TEST(LoggingTest, VersionMacros)
{
DART_INFO("DART_VERSION: {}", DART_VERSION);
DART_INFO("DART_DESCRIPTION: {}", DART_DESCRIPTION);
EXPECT_TRUE(DART_VERSION_AT_LEAST(5, 999, 999));
EXPECT_TRUE(DART_VERSION_AT_LEAST(6, 13, 999));
EXPECT_TRUE(DART_VERSION_AT_LEAST(6, 14, 1));
}

0 comments on commit e11c65f

Please sign in to comment.