summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Zach Hilman2019-06-10 00:31:49 -0400
committerGravatar Zach Hilman2019-06-10 00:31:54 -0400
commit3a26b49c2cfb50f312bca63b897480c10bc6329c (patch)
treece7795b2ec2334dd9f989ce00d114dfacad8e0d9 /src
parentyuzu_tester: Display results in table format (diff)
downloadyuzu-3a26b49c2cfb50f312bca63b897480c10bc6329c.tar.gz
yuzu-3a26b49c2cfb50f312bca63b897480c10bc6329c.tar.xz
yuzu-3a26b49c2cfb50f312bca63b897480c10bc6329c.zip
yuzutest: Add minor comments
Diffstat (limited to 'src')
-rw-r--r--src/yuzu_tester/service/yuzutest.cpp2
-rw-r--r--src/yuzu_tester/yuzu.cpp15
2 files changed, 9 insertions, 8 deletions
diff --git a/src/yuzu_tester/service/yuzutest.cpp b/src/yuzu_tester/service/yuzutest.cpp
index a5e5bddb2..85d3f436b 100644
--- a/src/yuzu_tester/service/yuzutest.cpp
+++ b/src/yuzu_tester/service/yuzutest.cpp
@@ -95,7 +95,7 @@ private:
95 IPC::ResponseBuilder rb{ctx, 2}; 95 IPC::ResponseBuilder rb{ctx, 2};
96 rb.Push(RESULT_SUCCESS); 96 rb.Push(RESULT_SUCCESS);
97 97
98 finish_callback(results); 98 finish_callback(std::move(results));
99 } 99 }
100 100
101 std::string data; 101 std::string data;
diff --git a/src/yuzu_tester/yuzu.cpp b/src/yuzu_tester/yuzu.cpp
index 4b4e3d4fc..b589c3de3 100644
--- a/src/yuzu_tester/yuzu.cpp
+++ b/src/yuzu_tester/yuzu.cpp
@@ -176,7 +176,10 @@ int main(int argc, char** argv) {
176 finished = true; 176 finished = true;
177 return_value = 0; 177 return_value = 0;
178 178
179 const auto len = 179 // Find the minimum length needed to fully enclose all test names (and the header field) in
180 // the fmt::format column by first finding the maximum size of any test name and comparing
181 // that to 9, the string length of 'Test Name'
182 const auto needed_length_name =
180 std::max<u64>(std::max_element(results.begin(), results.end(), 183 std::max<u64>(std::max_element(results.begin(), results.end(),
181 [](const auto& lhs, const auto& rhs) { 184 [](const auto& lhs, const auto& rhs) {
182 return lhs.name.size() < rhs.name.size(); 185 return lhs.name.size() < rhs.name.size();
@@ -187,7 +190,8 @@ int main(int argc, char** argv) {
187 std::size_t passed = 0; 190 std::size_t passed = 0;
188 std::size_t failed = 0; 191 std::size_t failed = 0;
189 192
190 std::cout << fmt::format("Result [Res Code] | {:<{}} | Extra Data", "Test Name", len) 193 std::cout << fmt::format("Result [Res Code] | {:<{}} | Extra Data", "Test Name",
194 needed_length_name)
191 << std::endl; 195 << std::endl;
192 196
193 for (const auto& res : results) { 197 for (const auto& res : results) {
@@ -196,8 +200,8 @@ int main(int argc, char** argv) {
196 ++passed; 200 ++passed;
197 else 201 else
198 ++failed; 202 ++failed;
199 std::cout << fmt::format("{} [{:08X}] | {:<{}} | {}", main_res, res.code, res.name, len, 203 std::cout << fmt::format("{} [{:08X}] | {:<{}} | {}", main_res, res.code, res.name,
200 res.data) 204 needed_length_name, res.data)
201 << std::endl; 205 << std::endl;
202 } 206 }
203 207
@@ -230,9 +234,6 @@ int main(int argc, char** argv) {
230 case Core::System::ResultStatus::ErrorNotInitialized: 234 case Core::System::ResultStatus::ErrorNotInitialized:
231 LOG_CRITICAL(Frontend, "CPUCore not initialized"); 235 LOG_CRITICAL(Frontend, "CPUCore not initialized");
232 return -1; 236 return -1;
233 case Core::System::ResultStatus::ErrorSystemMode:
234 LOG_CRITICAL(Frontend, "Failed to determine system mode!");
235 return -1;
236 case Core::System::ResultStatus::ErrorVideoCore: 237 case Core::System::ResultStatus::ErrorVideoCore:
237 LOG_CRITICAL(Frontend, "Failed to initialize VideoCore!"); 238 LOG_CRITICAL(Frontend, "Failed to initialize VideoCore!");
238 return -1; 239 return -1;