diff options
author | Rodrigo Locatti <reinuseslisp@airmail.cc> | 2020-11-27 06:41:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-27 06:41:56 +0100 |
commit | ee5e77fbf97da699e5ded623c12cad56dd7ce0da (patch) | |
tree | 66940e6456e66688af258d1e56d846eedd82d5b6 /src/yuzu_tester | |
parent | Merge pull request #5016 from comex/xx-push (diff) | |
parent | service: Eliminate usages of the global system instance (diff) | |
download | yuzu-ee5e77fbf97da699e5ded623c12cad56dd7ce0da.tar yuzu-ee5e77fbf97da699e5ded623c12cad56dd7ce0da.tar.gz yuzu-ee5e77fbf97da699e5ded623c12cad56dd7ce0da.tar.bz2 yuzu-ee5e77fbf97da699e5ded623c12cad56dd7ce0da.tar.lz yuzu-ee5e77fbf97da699e5ded623c12cad56dd7ce0da.tar.xz yuzu-ee5e77fbf97da699e5ded623c12cad56dd7ce0da.tar.zst yuzu-ee5e77fbf97da699e5ded623c12cad56dd7ce0da.zip |
Diffstat (limited to '')
-rw-r--r-- | src/yuzu_tester/service/yuzutest.cpp | 15 | ||||
-rw-r--r-- | src/yuzu_tester/service/yuzutest.h | 6 | ||||
-rw-r--r-- | src/yuzu_tester/yuzu.cpp | 3 |
3 files changed, 14 insertions, 10 deletions
diff --git a/src/yuzu_tester/service/yuzutest.cpp b/src/yuzu_tester/service/yuzutest.cpp index 2d3f6e3a7..e257fae25 100644 --- a/src/yuzu_tester/service/yuzutest.cpp +++ b/src/yuzu_tester/service/yuzutest.cpp @@ -4,6 +4,7 @@ #include <memory> #include "common/string_util.h" +#include "core/core.h" #include "core/hle/ipc_helpers.h" #include "core/hle/service/service.h" #include "core/hle/service/sm/sm.h" @@ -15,10 +16,10 @@ constexpr u64 SERVICE_VERSION = 0x00000002; class YuzuTest final : public ServiceFramework<YuzuTest> { public: - explicit YuzuTest(std::string data, - std::function<void(std::vector<TestResult>)> finish_callback) - : ServiceFramework{"yuzutest"}, data(std::move(data)), - finish_callback(std::move(finish_callback)) { + explicit YuzuTest(Core::System& system_, std::string data_, + std::function<void(std::vector<TestResult>)> finish_callback_) + : ServiceFramework{system_, "yuzutest"}, data{std::move(data_)}, finish_callback{std::move( + finish_callback_)} { static const FunctionInfo functions[] = { {0, &YuzuTest::Initialize, "Initialize"}, {1, &YuzuTest::GetServiceVersion, "GetServiceVersion"}, @@ -104,9 +105,11 @@ private: std::function<void(std::vector<TestResult>)> finish_callback; }; -void InstallInterfaces(SM::ServiceManager& sm, std::string data, +void InstallInterfaces(Core::System& system, std::string data, std::function<void(std::vector<TestResult>)> finish_callback) { - std::make_shared<YuzuTest>(data, finish_callback)->InstallAsService(sm); + auto& sm = system.ServiceManager(); + std::make_shared<YuzuTest>(system, std::move(data), std::move(finish_callback)) + ->InstallAsService(sm); } } // namespace Service::Yuzu diff --git a/src/yuzu_tester/service/yuzutest.h b/src/yuzu_tester/service/yuzutest.h index eca129c8c..7794814fa 100644 --- a/src/yuzu_tester/service/yuzutest.h +++ b/src/yuzu_tester/service/yuzutest.h @@ -7,8 +7,8 @@ #include <functional> #include <string> -namespace Service::SM { -class ServiceManager; +namespace Core { +class System; } namespace Service::Yuzu { @@ -19,7 +19,7 @@ struct TestResult { std::string name; }; -void InstallInterfaces(SM::ServiceManager& sm, std::string data, +void InstallInterfaces(Core::System& system, std::string data, std::function<void(std::vector<TestResult>)> finish_callback); } // namespace Service::Yuzu diff --git a/src/yuzu_tester/yuzu.cpp b/src/yuzu_tester/yuzu.cpp index 88e4bd1f7..ea94a6537 100644 --- a/src/yuzu_tester/yuzu.cpp +++ b/src/yuzu_tester/yuzu.cpp @@ -247,9 +247,10 @@ int main(int argc, char** argv) { "additional help.\n\nError Code: {:04X}-{:04X}\nError Description: {}", loader_id, error_id, static_cast<Loader::ResultStatus>(error_id)); } + break; } - Service::Yuzu::InstallInterfaces(system.ServiceManager(), datastring, callback); + Service::Yuzu::InstallInterfaces(system, datastring, callback); system.TelemetrySession().AddField(Common::Telemetry::FieldType::App, "Frontend", "SDLHideTester"); |