Skip to content
Merged
Show file tree
Hide file tree
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
22 changes: 1 addition & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ jobs:
os:
- name: ubuntu
version: 24.04
- name: windows
version: 2022
- name: windows
version: 2025-vs2026
build_type:
Expand All @@ -99,34 +97,16 @@ jobs:
version: 21
executable: clang++-21
cxxflags: -stdlib=libc++ -fcolor-diagnostics
- name: MSVC
toolset: msvc
version: 2022
toolset_version: 14.44
vs-path: C:\Program Files\Microsoft Visual Studio\2022\Enterprise
cmake_config_additional_args: -G "Visual Studio 17 2022"
builder_additional_args: -- "-consoleLoggerParameters:ForceConsoleColor"
executable: cl
- name: MSVC
toolset: msvc
version: 2026
toolset_version: 14.50
toolset_version: 14.51
vs-path: C:\Program Files\Microsoft Visual Studio\18\Enterprise
cmake_config_additional_args: -G "Visual Studio 18 2026"
builder_additional_args: -- "-consoleLoggerParameters:ForceConsoleColor"
executable: cl

exclude:
- os:
name: windows
version: 2022
compiler:
version: 2026
- os:
name: windows
version: 2025-vs2026
compiler:
version: 2022
- os:
name: windows
compiler:
Expand Down
2 changes: 1 addition & 1 deletion modules/iris
Submodule iris updated 1 files
+1 −21 .github/workflows/ci.yml
37 changes: 29 additions & 8 deletions test/x4/smart_ptr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,27 @@
#include <iris/x4/numeric/int.hpp>

#include <stdexcept>
#include <memory>

template<class T>
struct throwing_parser : x4::parser<throwing_parser<T>>
{
using attribute_type = T;

template<std::forward_iterator It, std::sentinel_for<It> Se, class Context, x4::X4Attribute Attr>
[[nodiscard]] static constexpr bool
parse(It&, Se const&, Context const&, Attr& attr_)
{
// Dummy condition for suppressing potential warning
if (std::addressof(attr_)) {
throw std::runtime_error("throwing_parser");
}
return false;
}
};

template<class T>
[[maybe_unused]] inline constexpr throwing_parser<T> always_throw{};

template<class T>
struct custom_deleter
Expand Down Expand Up @@ -43,7 +64,7 @@ TEST_CASE("unique_ptr (std::default_delete<T>)")
{
std::unique_ptr<int> result;
REQUIRE_THROWS_AS(
parse("1", unique_ptr<int>(eps[([] { throw std::runtime_error{"failed"}; })]), result),
parse("1", unique_ptr<int>(always_throw<int>), result),
std::runtime_error
);
REQUIRE(!result);
Expand All @@ -65,7 +86,7 @@ TEST_CASE("unique_ptr (std::default_delete<T>)")
{
std::unique_ptr<int> result = std::make_unique<int>(42);
REQUIRE_THROWS_AS(
parse("1", unique_ptr<int>(eps[([] { throw std::runtime_error{"failed"}; })]), result),
parse("1", unique_ptr<int>(always_throw<int>), result),
std::runtime_error
);
REQUIRE(!!result);
Expand Down Expand Up @@ -94,7 +115,7 @@ TEST_CASE("unique_ptr (custom deleter)")
{
std::unique_ptr<int, custom_deleter<int>> result;
REQUIRE_THROWS_AS(
parse("1", unique_ptr<int, custom_deleter<int>>(eps[([] { throw std::runtime_error{"failed"}; })]), result),
parse("1", unique_ptr<int, custom_deleter<int>>(always_throw<int>), result),
std::runtime_error
);
REQUIRE(!result);
Expand All @@ -116,7 +137,7 @@ TEST_CASE("unique_ptr (custom deleter)")
{
std::unique_ptr<int, custom_deleter<int>> result(new int(42), custom_deleter<int>{});
REQUIRE_THROWS_AS(
parse("1", unique_ptr<int, custom_deleter<int>>(eps[([] { throw std::runtime_error{"failed"}; })]), result),
parse("1", unique_ptr<int, custom_deleter<int>>(always_throw<int>), result),
std::runtime_error
);
REQUIRE(!!result);
Expand Down Expand Up @@ -145,7 +166,7 @@ TEST_CASE("shared_ptr (std::default_delete<T>)")
{
std::shared_ptr<int> result;
REQUIRE_THROWS_AS(
parse("1", shared_ptr<int>(eps[([] { throw std::runtime_error{"failed"}; })]), result),
parse("1", shared_ptr<int>(always_throw<int>), result),
std::runtime_error
);
REQUIRE(!result);
Expand All @@ -167,7 +188,7 @@ TEST_CASE("shared_ptr (std::default_delete<T>)")
{
std::shared_ptr<int> result = std::make_shared<int>(42);
REQUIRE_THROWS_AS(
parse("1", shared_ptr<int>(eps[([] { throw std::runtime_error{"failed"}; })]), result),
parse("1", shared_ptr<int>(always_throw<int>), result),
std::runtime_error
);
REQUIRE(!!result);
Expand Down Expand Up @@ -196,7 +217,7 @@ TEST_CASE("shared_ptr (custom deleter)")
{
std::shared_ptr<int> result;
REQUIRE_THROWS_AS(
parse("1", shared_ptr<int, custom_deleter<int>>(eps[([] { throw std::runtime_error{"failed"}; })]), result),
parse("1", shared_ptr<int, custom_deleter<int>>(always_throw<int>), result),
std::runtime_error
);
REQUIRE(!result);
Expand All @@ -218,7 +239,7 @@ TEST_CASE("shared_ptr (custom deleter)")
{
std::shared_ptr<int> result(new int(42), custom_deleter<int>{});
REQUIRE_THROWS_AS(
parse("1", shared_ptr<int, custom_deleter<int>>(eps[([] { throw std::runtime_error{"failed"}; })]), result),
parse("1", shared_ptr<int, custom_deleter<int>>(always_throw<int>), result),
std::runtime_error
);
REQUIRE(!!result);
Expand Down
Loading