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

STEllAR-GROUP / hpx / #852

17 Dec 2022 04:43PM UTC coverage: 85.912% (-0.7%) from 86.568%
#852

push

StellarBot
Merge #6106

6106: Modernizing modules of levels 0 to 5 r=hkaiser a=hkaiser

- flyby: HPX_FORWARD/HPX_MOVE now expand to std::forward and std::move if those are implemented as builtin functions

working towards #5497

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

87 of 87 new or added lines in 24 files covered. (100.0%)

173152 of 201546 relevant lines covered (85.91%)

1910264.28 hits per line

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

21.62
/libs/full/async_distributed/tests/unit/async_remote_client.cpp
1
//  Copyright (c) 2007-2015 Hartmut Kaiser
2
//
3
//  SPDX-License-Identifier: BSL-1.0
4
//  Distributed under the Boost Software License, Version 1.0. (See accompanying
5
//  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6

7
#include <hpx/config.hpp>
8
#if !defined(HPX_COMPUTE_DEVICE_CODE)
9
#include <hpx/hpx_init.hpp>
10
#include <hpx/include/actions.hpp>
11
#include <hpx/include/async.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 <cstdint>
18
#include <vector>
19

20
///////////////////////////////////////////////////////////////////////////////
21
struct decrement_server
6✔
22
  : hpx::components::managed_component_base<decrement_server>
23
{
24
    std::int32_t call(std::int32_t i) const
7✔
25
    {
26
        return i - 1;
7✔
27
    }
28

29
    HPX_DEFINE_COMPONENT_ACTION(decrement_server, call)
30
};
31

32
typedef hpx::components::managed_component<decrement_server> server_type;
33
HPX_REGISTER_COMPONENT(server_type, decrement_server)
55✔
34

35
typedef decrement_server::call_action call_action;
36
HPX_REGISTER_ACTION_DECLARATION(call_action)
37
HPX_REGISTER_ACTION(call_action)
10✔
38

39
///////////////////////////////////////////////////////////////////////////////
40
void test_remote_async(hpx::id_type const& target)
×
41
{
42
    typedef hpx::components::client<decrement_server> decrement_client;
43

44
    {
45
        decrement_client dec_f =
46
            hpx::components::new_<decrement_client>(target);
×
47

48
        call_action call;
49
        hpx::future<std::int32_t> f1 = hpx::async(call, dec_f, 42);
×
50
        HPX_TEST_EQ(f1.get(), 41);
×
51

52
        hpx::future<std::int32_t> f2 =
53
            hpx::async(hpx::launch::all, call, dec_f, 42);
×
54
        HPX_TEST_EQ(f2.get(), 41);
×
55
    }
×
56

57
    {
58
        decrement_client dec_f =
59
            hpx::components::new_<decrement_client>(target);
×
60

61
        call_action call;
62

63
        hpx::future<std::int32_t> f1 = hpx::async(hpx::bind(call, dec_f, 42));
×
64
        HPX_TEST_EQ(f1.get(), 41);
×
65

66
        using hpx::placeholders::_1;
67
        using hpx::placeholders::_2;
68

69
        hpx::future<std::int32_t> f2 =
70
            hpx::async(hpx::bind(call, _1, 42), dec_f);
×
71
        HPX_TEST_EQ(f2.get(), 41);
×
72

73
        hpx::future<std::int32_t> f3 =
74
            hpx::async(hpx::bind(call, _1, _2), dec_f, 42);
×
75
        HPX_TEST_EQ(f3.get(), 41);
×
76
    }
×
77

78
    {
79
        decrement_client dec_f =
80
            hpx::components::new_<decrement_client>(target);
×
81

82
        hpx::future<std::int32_t> f1 = hpx::async<call_action>(dec_f, 42);
×
83
        HPX_TEST_EQ(f1.get(), 41);
×
84

85
        hpx::future<std::int32_t> f2 =
86
            hpx::async<call_action>(hpx::launch::all, dec_f, 42);
×
87
        HPX_TEST_EQ(f2.get(), 41);
×
88
    }
×
89
}
×
90

91
int hpx_main()
×
92
{
93
    std::vector<hpx::id_type> localities = hpx::find_all_localities();
×
94
    for (hpx::id_type const& id : localities)
×
95
    {
96
        test_remote_async(id);
×
97
    }
98
    return hpx::finalize();
×
99
}
×
100

101
int main(int argc, char* argv[])
1✔
102
{
103
    // Initialize and run HPX
104
    HPX_TEST_EQ_MSG(
1✔
105
        hpx::init(argc, argv), 0, "HPX main exited with non-zero status");
106

107
    return hpx::util::report_errors();
1✔
108
}
×
109
#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

© 2025 Coveralls, Inc