diff options
| author | 2020-02-10 14:45:08 -0400 | |
|---|---|---|
| committer | 2020-06-18 16:29:21 -0400 | |
| commit | 1f7dd36499786d373b143a4437d4c32e077a32aa (patch) | |
| tree | 26d21b113d85c6630f3ff67f7affc7c1b6f508a5 /src/tests/common/fibers.cpp | |
| parent | Common: Make MinGW build use Windows Fibers instead of fcontext_t (diff) | |
| download | yuzu-1f7dd36499786d373b143a4437d4c32e077a32aa.tar.gz yuzu-1f7dd36499786d373b143a4437d4c32e077a32aa.tar.xz yuzu-1f7dd36499786d373b143a4437d4c32e077a32aa.zip | |
Common/Tests: Address Feedback
Diffstat (limited to 'src/tests/common/fibers.cpp')
| -rw-r--r-- | src/tests/common/fibers.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/tests/common/fibers.cpp b/src/tests/common/fibers.cpp index d63194dd4..0d3d5153d 100644 --- a/src/tests/common/fibers.cpp +++ b/src/tests/common/fibers.cpp | |||
| @@ -34,7 +34,7 @@ public: | |||
| 34 | }; | 34 | }; |
| 35 | 35 | ||
| 36 | static void WorkControl1(void* control) { | 36 | static void WorkControl1(void* control) { |
| 37 | TestControl1* test_control = static_cast<TestControl1*>(control); | 37 | auto* test_control = static_cast<TestControl1*>(control); |
| 38 | test_control->DoWork(); | 38 | test_control->DoWork(); |
| 39 | } | 39 | } |
| 40 | 40 | ||
| @@ -70,8 +70,8 @@ static void ThreadStart1(u32 id, TestControl1& test_control) { | |||
| 70 | TEST_CASE("Fibers::Setup", "[common]") { | 70 | TEST_CASE("Fibers::Setup", "[common]") { |
| 71 | constexpr u32 num_threads = 7; | 71 | constexpr u32 num_threads = 7; |
| 72 | TestControl1 test_control{}; | 72 | TestControl1 test_control{}; |
| 73 | test_control.thread_fibers.resize(num_threads, nullptr); | 73 | test_control.thread_fibers.resize(num_threads); |
| 74 | test_control.work_fibers.resize(num_threads, nullptr); | 74 | test_control.work_fibers.resize(num_threads); |
| 75 | test_control.items.resize(num_threads, 0); | 75 | test_control.items.resize(num_threads, 0); |
| 76 | test_control.results.resize(num_threads, 0); | 76 | test_control.results.resize(num_threads, 0); |
| 77 | std::vector<std::thread> threads; | 77 | std::vector<std::thread> threads; |
| @@ -153,17 +153,17 @@ public: | |||
| 153 | }; | 153 | }; |
| 154 | 154 | ||
| 155 | static void WorkControl2_1(void* control) { | 155 | static void WorkControl2_1(void* control) { |
| 156 | TestControl2* test_control = static_cast<TestControl2*>(control); | 156 | auto* test_control = static_cast<TestControl2*>(control); |
| 157 | test_control->DoWork1(); | 157 | test_control->DoWork1(); |
| 158 | } | 158 | } |
| 159 | 159 | ||
| 160 | static void WorkControl2_2(void* control) { | 160 | static void WorkControl2_2(void* control) { |
| 161 | TestControl2* test_control = static_cast<TestControl2*>(control); | 161 | auto* test_control = static_cast<TestControl2*>(control); |
| 162 | test_control->DoWork2(); | 162 | test_control->DoWork2(); |
| 163 | } | 163 | } |
| 164 | 164 | ||
| 165 | static void WorkControl2_3(void* control) { | 165 | static void WorkControl2_3(void* control) { |
| 166 | TestControl2* test_control = static_cast<TestControl2*>(control); | 166 | auto* test_control = static_cast<TestControl2*>(control); |
| 167 | test_control->DoWork3(); | 167 | test_control->DoWork3(); |
| 168 | } | 168 | } |
| 169 | 169 | ||
| @@ -198,7 +198,7 @@ static void ThreadStart2_2(u32 id, TestControl2& test_control) { | |||
| 198 | */ | 198 | */ |
| 199 | TEST_CASE("Fibers::InterExchange", "[common]") { | 199 | TEST_CASE("Fibers::InterExchange", "[common]") { |
| 200 | TestControl2 test_control{}; | 200 | TestControl2 test_control{}; |
| 201 | test_control.thread_fibers.resize(2, nullptr); | 201 | test_control.thread_fibers.resize(2); |
| 202 | test_control.fiber1 = | 202 | test_control.fiber1 = |
| 203 | std::make_shared<Fiber>(std::function<void(void*)>{WorkControl2_1}, &test_control); | 203 | std::make_shared<Fiber>(std::function<void(void*)>{WorkControl2_1}, &test_control); |
| 204 | test_control.fiber2 = | 204 | test_control.fiber2 = |
| @@ -261,12 +261,12 @@ public: | |||
| 261 | }; | 261 | }; |
| 262 | 262 | ||
| 263 | static void WorkControl3_1(void* control) { | 263 | static void WorkControl3_1(void* control) { |
| 264 | TestControl3* test_control = static_cast<TestControl3*>(control); | 264 | auto* test_control = static_cast<TestControl3*>(control); |
| 265 | test_control->DoWork1(); | 265 | test_control->DoWork1(); |
| 266 | } | 266 | } |
| 267 | 267 | ||
| 268 | static void WorkControl3_2(void* control) { | 268 | static void WorkControl3_2(void* control) { |
| 269 | TestControl3* test_control = static_cast<TestControl3*>(control); | 269 | auto* test_control = static_cast<TestControl3*>(control); |
| 270 | test_control->DoWork2(); | 270 | test_control->DoWork2(); |
| 271 | } | 271 | } |
| 272 | 272 | ||
| @@ -295,7 +295,7 @@ static void ThreadStart3(u32 id, TestControl3& test_control) { | |||
| 295 | */ | 295 | */ |
| 296 | TEST_CASE("Fibers::StartRace", "[common]") { | 296 | TEST_CASE("Fibers::StartRace", "[common]") { |
| 297 | TestControl3 test_control{}; | 297 | TestControl3 test_control{}; |
| 298 | test_control.thread_fibers.resize(2, nullptr); | 298 | test_control.thread_fibers.resize(2); |
| 299 | test_control.fiber1 = | 299 | test_control.fiber1 = |
| 300 | std::make_shared<Fiber>(std::function<void(void*)>{WorkControl3_1}, &test_control); | 300 | std::make_shared<Fiber>(std::function<void(void*)>{WorkControl3_1}, &test_control); |
| 301 | test_control.fiber2 = | 301 | test_control.fiber2 = |