Skip to content

Commit 5d22361

Browse files
committed
Fixing newly added test and serialization of std::system_error
- flyby: moved test to regression directory Signed-off-by: Hartmut Kaiser <hartmut.kaiser@gmail.com>
1 parent 196d20e commit 5d22361

5 files changed

Lines changed: 13 additions & 12 deletions

File tree

libs/core/errors/include/hpx/errors/macros.hpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@
1818

1919
#include <type_traits>
2020

21-
#if !defined(HPX_HAVE_CXX_MODULES) || defined(HPX_CORE_EXPORTS) || \
22-
(defined(HPX_COMPILE_BMI) && defined(HPX_COMPILE_CORE_WITH_MODULES))
23-
#include <hpx/errors/throw_exception.hpp>
24-
#endif
25-
2621
/// \cond NOINTERNAL
2722
///////////////////////////////////////////////////////////////////////////////
2823
// helper macro allowing to prepend file name and line number to a generated

libs/core/serialization/src/exception_ptr.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ namespace hpx::serialization {
6767
throw_line_ = *line;
6868
}
6969
}
70+
// NOLINTNEXTLINE(bugprone-empty-catch)
71+
catch (...)
72+
{
73+
// plain exception_ptr (unrelated to HPX) was serialized, no
74+
// special information is available
75+
}
7076

7177
// figure out concrete underlying exception type
7278
try
@@ -267,7 +273,7 @@ namespace hpx::serialization {
267273
case hpx::util::exception_type::std_system_error:
268274
e = hpx::detail::get_exception(
269275
std::system_error(static_cast<int>(err_value),
270-
std::system_category(), err_message),
276+
std::system_category(), what),
271277
throw_function_, throw_file_, throw_line_);
272278
break;
273279

libs/core/serialization/tests/regressions/CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
# Copyright (c) 2019-2022 The STE||AR-Group
1+
# Copyright (c) 2019-2026 The STE||AR-Group
22
#
33
# SPDX-License-Identifier: BSL-1.0
44
# Distributed under the Boost Software License, Version 1.0. (See accompanying
55
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
66

7-
set(tests buffer_overrun_2839 non_default_constructible_5886
8-
not_bitwise_shared_ptr_serialization serialization_unsigned_buffer
7+
set(tests
8+
buffer_overrun_2839 non_default_constructible_5886
9+
not_bitwise_shared_ptr_serialization serialization_exception_ptr
10+
serialization_unsigned_buffer
911
)
1012

1113
foreach(test ${tests})

libs/core/serialization/tests/unit/serialization_exception_ptr.cpp renamed to libs/core/serialization/tests/regressions/serialization_exception_ptr.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,9 @@
2121
// the deserialized exception carries the original, ungarbled values.
2222

2323
#include <hpx/config.hpp>
24-
#include <hpx/errors/throw_exception.hpp>
2524
#include <hpx/modules/errors.hpp>
2625
#include <hpx/modules/serialization.hpp>
2726
#include <hpx/modules/testing.hpp>
28-
#include <hpx/serialization/exception_ptr.hpp>
2927

3028
#include <climits>
3129
#include <exception>

libs/core/serialization/tests/unit/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ set(tests
2929
serialization_std_variant
3030
)
3131

32-
set(full_tests serialization_raw_pointer serialization_exception_ptr)
32+
set(full_tests serialization_raw_pointer)
3333

3434
if(HPX_SERIALIZATION_WITH_BOOST_TYPES)
3535
set(tests ${tests} serialization_boost_variant)

0 commit comments

Comments
 (0)