Skip to content

Commit

Permalink
test ASan
Browse files Browse the repository at this point in the history
  • Loading branch information
johnmcfarlane authored and John McFarlane committed May 26, 2022
1 parent 623c335 commit a2a9767
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ jobs:
# Build and test many combinations on Linux/OS X using Conan
clang-tidy:
strategy:
fail-fast: false
matrix:
int128: ["True", "False"]

Expand Down Expand Up @@ -71,6 +72,7 @@ jobs:
# Build and test many combinations on Linux/OS X using Conan
conan:
strategy:
fail-fast: false
matrix:
name: [
clang-14-libc++, clang-14-libstdc++,
Expand Down Expand Up @@ -226,6 +228,7 @@ jobs:
# Build and test on Windows using Conan
windows:
strategy:
fail-fast: false
matrix:
name: [2022-64, 2022-32, 2019-64, 2019-32]
include:
Expand Down
9 changes: 7 additions & 2 deletions test/unit/cmath.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ static_assert(identical(2, cnl::sqrt(4)));

TEST(cmake, sqrt_float) // NOLINT
{
auto const expected{3.5};
auto const expected{new double{3.5}};
auto const actual{cnl::sqrt(12.25)};
ASSERT_EQ(expected, actual);
// NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks)
ASSERT_EQ(*expected, actual);
if (actual > 42) {
// NOLINTNEXTLINE(cppcoreguidelines-owning-memory)
delete expected;
}
}

0 comments on commit a2a9767

Please sign in to comment.