-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ControllerEngine Refactoring #3463
Changes from 76 commits
fed2e1b
9c04291
24408ab
979a243
b3d6ff8
72e849f
0968a9d
77ca43f
8153b3f
9363b49
e25bf12
e8e2487
26b51ec
e99cef3
f6f7050
b4d2d21
197c0d0
62fc40c
2046add
a691d32
487f8f9
2b6eb9f
fa16b57
427ba5e
caf3d68
6c1a6b6
df4f377
8ec7ed8
0d39501
13f86a5
e028e3e
5c1ace9
bdf497b
3383aef
19b9aaf
4505c86
95b83ea
e4bdfdd
269de0d
d72618f
d677f4b
5b02715
424c94b
d50b710
fa8771f
c96a2c2
cb41ffd
a80ca2c
f7b0ddc
0112554
65de8c5
94d9423
388b4e3
57c0219
e504678
e35e90f
5b81d28
98d9e37
4e744e0
6a78b67
0e6119c
145cf8e
7f2187d
30692a1
86bebb6
4227e22
b8e2430
20fbcb0
b5cf59d
1911580
b5fafcc
57b7406
3a40266
221dab8
66f447c
7e770cf
de29f92
6c8cb90
4c95980
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -2,6 +2,8 @@ | ||||||||||
|
|||||||||||
#include <QDebug> | |||||||||||
|
|||||||||||
#include "control/control.h" | |||||||||||
|
|||||||||||
// Specifies whether or not we should dump incoming data to the console at | |||||||||||
// runtime. This is useful for end-user debugging and script-writing. | |||||||||||
class ControllerDebug { | |||||||||||
|
@@ -23,10 +25,24 @@ class ControllerDebug { | ||||||||||
s_enabled = false; | |||||||||||
} | |||||||||||
|
|||||||||||
static void enableTesting() { | |||||||||||
s_enabled = true; | |||||||||||
s_testing = true; | |||||||||||
} | |||||||||||
|
|||||||||||
static ControlFlags shouldAssertForInvalidControlObjects() { | |||||||||||
if (s_enabled && !s_testing) { | |||||||||||
return ControlFlag::None; | |||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. None means assert all assumptions. What is the reasoning that we don't want that during tests? Is this correct:
Please add a comment why. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We may also consider to rename ControlFlag::None to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This was done because some tests are expected to fail. I just pushed the new commits that disable controller testing for these tests. |
|||||||||||
} | |||||||||||
|
|||||||||||
return ControlFlag::AllowMissingOrInvalid; | |||||||||||
} | |||||||||||
|
|||||||||||
private: | |||||||||||
ControllerDebug() = delete; | |||||||||||
|
|||||||||||
static bool s_enabled; | |||||||||||
static bool s_testing; | |||||||||||
}; | |||||||||||
|
|||||||||||
// Usage: controllerDebug("hello" << "world"); | |||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function name is a question that can be answered with true or false but not with individual flags.
I would prefer to make this bool, because the flags are an implementation detail of code out of sight.
Alternative we need a new name.