• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

STEllAR-GROUP / hpx / #867

15 Jan 2023 08:00PM UTC coverage: 86.487% (+0.5%) from 85.951%
#867

push

StellarBot
Merge #6135

6135: Fixing warnings reported by MSVC analysis r=hkaiser a=hkaiser

- adding MSVC specific #pragma's to suppress the benign warnings


Co-authored-by: Hartmut Kaiser <hartmut.kaiser@gmail.com>

120 of 120 new or added lines in 33 files covered. (100.0%)

174599 of 201880 relevant lines covered (86.49%)

1945607.64 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

30.0
/libs/full/async_distributed/tests/regressions/return_future_2847.cpp
1
//  Copyright (c) 2014-2017 Hartmut Kaiser
2
//  Copyright (c) 2017 Igor Krivenko
3
//
4
//  SPDX-License-Identifier: BSL-1.0
5
//  Distributed under the Boost Software License, Version 1.0. (See accompanying
6
//  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7

8
#include <hpx/config.hpp>
9
#if !defined(HPX_COMPUTE_DEVICE_CODE)
10
#include <hpx/hpx_main.hpp>
11
#include <hpx/include/actions.hpp>
12
#include <hpx/include/components.hpp>
13
#include <hpx/include/lcos.hpp>
14
#include <hpx/include/runtime.hpp>
15
#include <hpx/modules/testing.hpp>
16

17
#include <cstddef>
18
#include <vector>
19

20
struct non_default_ctor
21
{
22
    int i;
23

24
    non_default_ctor() = delete;
25
    non_default_ctor(int i)
200✔
26
      : i(i)
200✔
27
    {
28
    }
200✔
29

30
    template <typename Archive>
31
    void serialize(Archive& ar, const unsigned int)
200✔
32
    {
33
        // clang-format off
34
        ar & i;
200✔
35
        // clang-format on
36
    }
200✔
37

38
    template <class Archive>
39
    void friend load_construct_data(
×
40
        Archive&, non_default_ctor* p, const unsigned int)
41
    {
42
        ::new (p) non_default_ctor(0);
×
43
    }
×
44
};
45

46
hpx::future<non_default_ctor> plain_future_non_default_ctor()
200✔
47
{
48
    return hpx::make_ready_future(non_default_ctor(42));
200✔
49
}
50

51
HPX_PLAIN_ACTION(
203✔
52
    plain_future_non_default_ctor, plain_future_non_default_ctor_action)
53

54
void test_plain_call_future_non_default_ctor(hpx::id_type id)
×
55
{
56
    // test apply
57
    for (std::size_t i = 0; i != 100; ++i)
×
58
    {
59
        hpx::post<plain_future_non_default_ctor_action>(id);
×
60
    }
×
61

62
    // test async
63
    std::vector<hpx::future<non_default_ctor>> calls;
×
64
    for (std::size_t i = 0; i != 100; ++i)
×
65
    {
66
        calls.push_back(hpx::async<plain_future_non_default_ctor_action>(id));
×
67
    }
×
68
    hpx::wait_all(calls);
×
69

70
    for (auto&& f : calls)
×
71
    {
72
        HPX_TEST_EQ(f.get().i, 42);
×
73
    }
74
}
×
75

76
///////////////////////////////////////////////////////////////////////////////
77
int main()
×
78
{
79
    for (hpx::id_type id : hpx::find_all_localities())
×
80
    {
81
        test_plain_call_future_non_default_ctor(id);
×
82
    }
×
83
    return hpx::util::report_errors();
×
84
}
×
85
#endif
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc