forked from snakster/cpp.react
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathParallelizationTest.h
More file actions
63 lines (49 loc) · 1.88 KB
/
ParallelizationTest.h
File metadata and controls
63 lines (49 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// Copyright Sebastian Jeckel 2014.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#pragma once
#include "gtest/gtest.h"
#include "react/Domain.h"
#include "react/Signal.h"
#include "react/Event.h"
#include "react/Observer.h"
#include "react/Algorithm.h"
///////////////////////////////////////////////////////////////////////////////////////////////////
namespace {
using namespace react;
using namespace std;
///////////////////////////////////////////////////////////////////////////////////////////////////
/// ParallelizationTest fixture
///////////////////////////////////////////////////////////////////////////////////////////////////
template <typename TParams>
class ParallelizationTest : public testing::Test
{
public:
template <EPropagationMode mode>
class MyEngine : public TParams::template EngineT<mode> {};
REACTIVE_DOMAIN(MyDomain, TParams::mode, MyEngine)
};
TYPED_TEST_CASE_P(ParallelizationTest);
///////////////////////////////////////////////////////////////////////////////////////////////////
/// Iterate1 test
///////////////////////////////////////////////////////////////////////////////////////////////////
TYPED_TEST_P(ParallelizationTest, WeightHint1)
{
using D = typename WeightHint1::MyDomain;
auto sig = MakeVar<D>(0);
auto evn = MakeEventSource<D,int>();
auto cont = MakeContinuation<D>(sig, [] (int v) {});
auto obs = Observe(evn, [] (int v) {});
sig.SetWeightHint(WeightHint::heavy);
evn.SetWeightHint(WeightHint::automatic);
cont.SetWeightHint(WeightHint::light);
obs.SetWeightHint(WeightHint::automatic);
}
///////////////////////////////////////////////////////////////////////////////////////////////////
REGISTER_TYPED_TEST_CASE_P
(
ParallelizationTest,
WeightHint1
);
} // ~namespace