summaryrefslogtreecommitdiffstats
path: root/src/tests/core
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2017-06-23 03:59:25 +0200
committerGitHub <noreply@github.com>2017-06-23 03:59:25 +0200
commit8223d180881aa997f13819507bef8941fdfce4cf (patch)
treea65e3e38c77d7bd65154cbe752746e73a77faf8a /src/tests/core
parentMerge pull request #2792 from wwylele/lutlutlut (diff)
parentKernel: Fix typo in test name (diff)
downloadyuzu-8223d180881aa997f13819507bef8941fdfce4cf.tar
yuzu-8223d180881aa997f13819507bef8941fdfce4cf.tar.gz
yuzu-8223d180881aa997f13819507bef8941fdfce4cf.tar.bz2
yuzu-8223d180881aa997f13819507bef8941fdfce4cf.tar.lz
yuzu-8223d180881aa997f13819507bef8941fdfce4cf.tar.xz
yuzu-8223d180881aa997f13819507bef8941fdfce4cf.tar.zst
yuzu-8223d180881aa997f13819507bef8941fdfce4cf.zip
Diffstat (limited to 'src/tests/core')
-rw-r--r--src/tests/core/hle/kernel/hle_ipc.cpp25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/tests/core/hle/kernel/hle_ipc.cpp b/src/tests/core/hle/kernel/hle_ipc.cpp
index e07a28c5b..52336d027 100644
--- a/src/tests/core/hle/kernel/hle_ipc.cpp
+++ b/src/tests/core/hle/kernel/hle_ipc.cpp
@@ -18,7 +18,7 @@ static SharedPtr<Object> MakeObject() {
return Event::Create(ResetType::OneShot);
}
-TEST_CASE("HLERequestContext::PopoulateFromIncomingCommandBuffer", "[core][kernel]") {
+TEST_CASE("HLERequestContext::PopulateFromIncomingCommandBuffer", "[core][kernel]") {
auto session = std::get<SharedPtr<ServerSession>>(ServerSession::CreateSessionPair());
HLERequestContext context(std::move(session));
@@ -94,6 +94,18 @@ TEST_CASE("HLERequestContext::PopoulateFromIncomingCommandBuffer", "[core][kerne
REQUIRE(context.GetIncomingHandle(output[5]) == c);
}
+ SECTION("translates null handles") {
+ const u32_le input[]{
+ IPC::MakeHeader(0, 0, 2), IPC::MoveHandleDesc(1), 0,
+ };
+
+ auto result = context.PopulateFromIncomingCommandBuffer(input, *process, handle_table);
+
+ REQUIRE(result == RESULT_SUCCESS);
+ auto* output = context.CommandBuffer();
+ REQUIRE(context.GetIncomingHandle(output[2]) == nullptr);
+ }
+
SECTION("translates CallingPid descriptors") {
const u32_le input[]{
IPC::MakeHeader(0, 0, 2), IPC::CallingPidDesc(), 0x98989898,
@@ -171,6 +183,17 @@ TEST_CASE("HLERequestContext::WriteToOutgoingCommandBuffer", "[core][kernel]") {
REQUIRE(handle_table.GetGeneric(output[4]) == b);
}
+ SECTION("translates null handles") {
+ input[0] = IPC::MakeHeader(0, 0, 2);
+ input[1] = IPC::MoveHandleDesc(1);
+ input[2] = context.AddOutgoingHandle(nullptr);
+
+ auto result = context.WriteToOutgoingCommandBuffer(output, *process, handle_table);
+
+ REQUIRE(result == RESULT_SUCCESS);
+ REQUIRE(output[2] == 0);
+ }
+
SECTION("translates multi-handle descriptors") {
auto a = MakeObject();
auto b = MakeObject();