Skip to content

Commit 78ef6f7

Browse files
committed
More header capitalization fixes
1 parent 9435078 commit 78ef6f7

File tree

3 files changed

+65
-64
lines changed

3 files changed

+65
-64
lines changed

list-devices.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
*/
88
#include <cstdio>
99

10-
#include "inputdevice.h"
11-
#include "inputdevicecollection.h"
10+
#include "InputDevice.h"
11+
#include "InputDeviceCollection.h"
1212

1313
int main() {
1414
fredemmott::inputmapping::InputDeviceCollection idc;

tests/CompositeSink_test.cpp

+10-10
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99
#include "CompositeSink.h"
1010

11-
#include "connections.h"
12-
#include "squaredeadzone.h"
1311
#include "MappableVJoyOutput.h"
12+
#include "SquareDeadzone.h"
13+
#include "connections.h"
1414
#include "tests.h"
1515

1616
using namespace fredemmott::inputmapping;
@@ -55,12 +55,12 @@ TEST_CASE("CompositeSink") {
5555
}
5656

5757
namespace {
58-
void static_test_ptrs() {
59-
MappableVJoyOutput vj(nullptr);
60-
TestAxis axis;
61-
static_assert(any_sink_ptr<decltype(vj.XAxis)>);
62-
static_assert(any_sink_ptr<decltype(vj.YAxis)>);
63-
static_assert(any_sink_ptr<decltype(vj.ZAxis)>);
64-
axis >> all(vj.XAxis, vj.YAxis, vj.ZAxis);
65-
}
58+
void static_test_ptrs() {
59+
MappableVJoyOutput vj(nullptr);
60+
TestAxis axis;
61+
static_assert(any_sink_ptr<decltype(vj.XAxis)>);
62+
static_assert(any_sink_ptr<decltype(vj.YAxis)>);
63+
static_assert(any_sink_ptr<decltype(vj.ZAxis)>);
64+
axis >> all(vj.XAxis, vj.YAxis, vj.ZAxis);
6665
}
66+
}// namespace

tests/SquareDeadzone_test.cpp

+53-52
Original file line numberDiff line numberDiff line change
@@ -6,66 +6,67 @@
66
* in the root directory of this source tree.
77
*/
88

9-
#include "squaredeadzone.h"
9+
#include "SquareDeadzone.h"
10+
1011
#include "tests.h"
1112

1213
using namespace fredemmott::inputmapping;
1314

14-
TEST_CASE("SquareDeadzone"){
15+
TEST_CASE("SquareDeadzone") {
1516
const auto percent = GENERATE(10, 90);
1617

17-
long out = -1;
18-
TestAxis axis;
19-
axis >> SquareDeadzone(percent) >> &out;
18+
long out = -1;
19+
TestAxis axis;
20+
axis >> SquareDeadzone(percent) >> &out;
2021

21-
axis.emit(0x7fff);// mid point
22-
// In deadzone
23-
REQUIRE(out == 0x7fff);
24-
axis.emit(0x8000);
25-
REQUIRE(out == 0x7fff);
26-
axis.emit(0x7ffe);
27-
REQUIRE(out == 0x7fff);
28-
// Out of deadzone: extremes
29-
axis.emit(0);
30-
REQUIRE(out == 0);
31-
axis.emit(0xffff);
32-
REQUIRE(out == 0xffff);
33-
// Return to deadzone
34-
axis.emit(0x80ff);
35-
REQUIRE(out == 0x7fff);
22+
axis.emit(0x7fff);// mid point
23+
// In deadzone
24+
REQUIRE(out == 0x7fff);
25+
axis.emit(0x8000);
26+
REQUIRE(out == 0x7fff);
27+
axis.emit(0x7ffe);
28+
REQUIRE(out == 0x7fff);
29+
// Out of deadzone: extremes
30+
axis.emit(0);
31+
REQUIRE(out == 0);
32+
axis.emit(0xffff);
33+
REQUIRE(out == 0xffff);
34+
// Return to deadzone
35+
axis.emit(0x80ff);
36+
REQUIRE(out == 0x7fff);
3637

37-
const long dz_size = round(0x8000 * percent / 100.0);
38-
// 1 change in input produces this size change in output...
39-
const double out_delta = 0x8000 * 1.0 / (0x8000 - dz_size);
40-
// ... but as we're using < and > constraints with a input of 1, we always
41-
// want the ceil
42-
const long delta_ceil = ceil(out_delta);
38+
const long dz_size = round(0x8000 * percent / 100.0);
39+
// 1 change in input produces this size change in output...
40+
const double out_delta = 0x8000 * 1.0 / (0x8000 - dz_size);
41+
// ... but as we're using < and > constraints with a input of 1, we always
42+
// want the ceil
43+
const long delta_ceil = ceil(out_delta);
4344

44-
// Just above center
45-
axis.emit(0x7fff + dz_size);
46-
REQUIRE(out == 0x7fff);
47-
axis.emit(0x7fff + dz_size + 1);
48-
REQUIRE(out > 0x7fff);
49-
REQUIRE(out <= 0x7fff + delta_ceil);
50-
// Near max
51-
axis.emit(0xfffe);
52-
REQUIRE(out == 0xffff - delta_ceil);
53-
// Just below center
54-
axis.emit(0x7fff - dz_size + 1);
55-
REQUIRE(out == 0x7fff);
56-
axis.emit(0x7fff - dz_size);
57-
REQUIRE(out < 0x7fff);
58-
REQUIRE(out >= 0x7fff - delta_ceil);
59-
// Near min
60-
axis.emit(1);
61-
REQUIRE(out >= 1);
62-
REQUIRE(out <= delta_ceil);
45+
// Just above center
46+
axis.emit(0x7fff + dz_size);
47+
REQUIRE(out == 0x7fff);
48+
axis.emit(0x7fff + dz_size + 1);
49+
REQUIRE(out > 0x7fff);
50+
REQUIRE(out <= 0x7fff + delta_ceil);
51+
// Near max
52+
axis.emit(0xfffe);
53+
REQUIRE(out == 0xffff - delta_ceil);
54+
// Just below center
55+
axis.emit(0x7fff - dz_size + 1);
56+
REQUIRE(out == 0x7fff);
57+
axis.emit(0x7fff - dz_size);
58+
REQUIRE(out < 0x7fff);
59+
REQUIRE(out >= 0x7fff - delta_ceil);
60+
// Near min
61+
axis.emit(1);
62+
REQUIRE(out >= 1);
63+
REQUIRE(out <= delta_ceil);
6364

64-
// Half way points
65-
axis.emit(0x7fff + 0x4000 + (dz_size / 2) + 1);
66-
REQUIRE(out >= 0x7fff + 0x4000);
67-
REQUIRE(out <= 0x7fff + 0x4000 + delta_ceil);
68-
axis.emit(0x7fff - 0x4000 - (dz_size / 2));
69-
REQUIRE(out <= 0x7fff - 0x4000);
70-
REQUIRE(out >= 0x7fff - 0x4000 - delta_ceil);
65+
// Half way points
66+
axis.emit(0x7fff + 0x4000 + (dz_size / 2) + 1);
67+
REQUIRE(out >= 0x7fff + 0x4000);
68+
REQUIRE(out <= 0x7fff + 0x4000 + delta_ceil);
69+
axis.emit(0x7fff - 0x4000 - (dz_size / 2));
70+
REQUIRE(out <= 0x7fff - 0x4000);
71+
REQUIRE(out >= 0x7fff - 0x4000 - delta_ceil);
7172
}

0 commit comments

Comments
 (0)