Skip to content

Commit

Permalink
test: update Eigen/Fmt compilation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Jan 26, 2024
1 parent 2127074 commit 42818f6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions tests/myproj/include/mylib/lib.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// test external pac
#include <Eigen/Dense>
#include <fmt/core.h>
#include <fmt/ostream.h>
#include <fmt/ranges.h>

// test std libraries
#include <iostream>
Expand All @@ -24,7 +24,7 @@ int some_fun() {
auto eigen_vec = Eigen::VectorXd::LinSpaced(10, 0, 1);

// print the vector
fmt::print("{}", eigen_vec);
fmt::print("[{}]", fmt::join(eigen_vec, ", "));

return 0;
}
6 changes: 3 additions & 3 deletions tests/myproj/src/main/main.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// test external pac
#include <Eigen/Dense>

Check warning on line 2 in tests/myproj/src/main/main.cpp

View workflow job for this annotation

GitHub Actions / Test (ubuntu-22.04, gcc, true, true)

included header Dense is not used directly [misc-include-cleaner]
#include <fmt/core.h>
#include <fmt/ostream.h>
#include <fmt/ranges.h>

Check warning on line 4 in tests/myproj/src/main/main.cpp

View workflow job for this annotation

GitHub Actions / Test (ubuntu-22.04, gcc, true, true)

included header ranges.h is not used directly [misc-include-cleaner]

// test std libraries
#include <iostream>

Check warning on line 7 in tests/myproj/src/main/main.cpp

View workflow job for this annotation

GitHub Actions / Test (ubuntu-22.04, gcc, true, true)

included header iostream is not used directly [misc-include-cleaner]
Expand All @@ -19,11 +19,11 @@ int main() {
fmt::print("Hello from fmt{}", "!");

Eigen::VectorXd eigen_vec = Eigen::Vector3d(1, 2, 3);
fmt::print("{}", eigen_vec);
fmt::print("[{}]", fmt::join(eigen_vec, ", "));

#if !defined(__MINGW32__) && !defined(__MSYS__) // TODO fails
Eigen::VectorXd eigen_vec2 = Eigen::VectorXd::LinSpaced(10, 0, 1);

Check warning on line 25 in tests/myproj/src/main/main.cpp

View workflow job for this annotation

GitHub Actions / Test (macos-12, llvm, true, true)

10 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers]

Check warning on line 25 in tests/myproj/src/main/main.cpp

View workflow job for this annotation

GitHub Actions / Test (macos-12, llvm, true, true)

10 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers]

Check warning on line 25 in tests/myproj/src/main/main.cpp

View workflow job for this annotation

GitHub Actions / Test (macos-11, gcc, true, true)

10 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers]

Check warning on line 25 in tests/myproj/src/main/main.cpp

View workflow job for this annotation

GitHub Actions / Test (macos-11, gcc, true, true)

10 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers]
fmt::print("{}", eigen_vec2);
fmt::print("[{}]", fmt::join(eigen_vec2, ", "));
#endif

// trigger address sanitizer
Expand Down
6 changes: 3 additions & 3 deletions tests/myproj/src/mylib2/lib.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// test external pac
#include <Eigen/Dense>
#include <fmt/core.h>
#include <fmt/ostream.h>
#include <fmt/ranges.h>

// test std libraries
#include <iostream>
Expand All @@ -19,11 +19,11 @@ int some_fun2() {
fmt::print("Hello from fmt{}", "!");

Eigen::VectorXd eigen_vec = Eigen::Vector3d(1, 2, 3);
fmt::print("{}", eigen_vec);
fmt::print("[{}]", fmt::join(eigen_vec, ", "));

#if !defined(__MINGW32__) && !defined(__MSYS__) // TODO fails
Eigen::VectorXd eigen_vec2 = Eigen::VectorXd::LinSpaced(10, 0, 1);

Check warning on line 25 in tests/myproj/src/mylib2/lib.cpp

View workflow job for this annotation

GitHub Actions / Test (macos-12, llvm, true, true)

10 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers]

Check warning on line 25 in tests/myproj/src/mylib2/lib.cpp

View workflow job for this annotation

GitHub Actions / Test (macos-12, llvm, true, true)

10 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers]

Check warning on line 25 in tests/myproj/src/mylib2/lib.cpp

View workflow job for this annotation

GitHub Actions / Test (macos-11, gcc, true, true)

10 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers]
fmt::print("{}", eigen_vec2);
fmt::print("[{}]", fmt::join(eigen_vec2, ", "));
#endif

return 0;
Expand Down

0 comments on commit 42818f6

Please sign in to comment.