forked from rusefi/rusefi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_nitrous_condition.cpp
More file actions
89 lines (68 loc) · 2.96 KB
/
Copy pathtest_nitrous_condition.cpp
File metadata and controls
89 lines (68 loc) · 2.96 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
//
// Created by kifir on 12/2/24.
//
#include "pch.h"
#include "nitrous_test_base.h"
namespace {
class NitrousConditionTest : public NitrousTestBase {
protected:
void SetUp() override;
};
void NitrousConditionTest::SetUp() {
TestBase::SetUp();
setUpTestConfiguration();
EXPECT_FALSE(getModule<NitrousController>().isNitrousArmed);
EXPECT_FALSE(getModule<NitrousController>().isNitrousSpeedCondition);
EXPECT_FALSE(getModule<NitrousController>().isNitrousTpsCondition);
EXPECT_FALSE(getModule<NitrousController>().isNitrousCltCondition);
EXPECT_FALSE(getModule<NitrousController>().isNitrousMapCondition);
EXPECT_FALSE(getModule<NitrousController>().isNitrousAfrCondition);
EXPECT_FALSE(getModule<NitrousController>().isNitrousRpmCondition);
checkNitrousCondition(false, "No conditions are satisfied");
armNitrousControl();
checkNitrousCondition(false, "Armed condition is satisfied");
satisfySpeedCondition();
checkNitrousCondition(false, "Armed + Speed conditions are satisfied");
satisfyTpsCondition();
checkNitrousCondition(false, "Armed + Speed + TPS conditions are satisfied");
satisfyCltCondition();
checkNitrousCondition(false, "Armed + Speed + TPS + CLT conditions are satisfied");
satisfyMapCondition();
checkNitrousCondition(false, "Armed + Speed + TPS + CLT + MAP conditions are satisfied");
satisfyAfrCondition();
checkNitrousCondition(false, "Armed + Speed + TPS + CLT + MAP + AFR conditions are satisfied");
satisfyRpmCondition();
checkNitrousCondition(
true,
"Armed + Speed + TPS + CLT + MAP + AFR + RPM conditions are satisfied"
);
}
TEST_F(NitrousConditionTest, checkWithoutArmedNitrousControl) {
unarmNitrousControl();
checkNitrousCondition(false, "Without armed condition");
}
TEST_F(NitrousConditionTest, checkWithoutSatisfiedSpeedCondition) {
unsatisfySpeedCondition();
checkNitrousCondition(false, "Without speed condition");
}
TEST_F(NitrousConditionTest, checkWithoutSatisfiedTpsCondition) {
unsatisfyTpsCondition();
checkNitrousCondition(false, "Without TPS condition");
}
TEST_F(NitrousConditionTest, checkWithoutSatisfiedCltCondition) {
unsatisfyCltCondition();
checkNitrousCondition(false, "Without CLT condition");
}
TEST_F(NitrousConditionTest, checkWithoutSatisfiedMapCondition) {
unsatisfyMapCondition();
checkNitrousCondition(false, "Without MAP condition");
}
TEST_F(NitrousConditionTest, checkWithoutSatisfiedAfrCondition) {
unsatisfyAfrCondition();
checkNitrousCondition(false, "Without AFR condition");
}
TEST_F(NitrousConditionTest, checkWithoutSatisfiedRpmCondition) {
unsatisfyRpmCondition();
checkNitrousCondition(false, "Without RPM condition");
}
}