summaryrefslogtreecommitdiffstats
path: root/src/tests
diff options
context:
space:
mode:
authorYuri Kunde Schlesner <yuriks@yuriks.net>2017-06-21 23:27:03 +0200
committerYuri Kunde Schlesner <yuriks@yuriks.net>2017-06-21 23:27:03 +0200
commitf64d0b3f263c077bc18920f47fe63524fdc6cd94 (patch)
tree0a05fac06caecd1c9a310da6a386fb5f84d86099 /src/tests
parentMerge pull request #2789 from yuriks/misc-kernel (diff)
downloadyuzu-f64d0b3f263c077bc18920f47fe63524fdc6cd94.tar
yuzu-f64d0b3f263c077bc18920f47fe63524fdc6cd94.tar.gz
yuzu-f64d0b3f263c077bc18920f47fe63524fdc6cd94.tar.bz2
yuzu-f64d0b3f263c077bc18920f47fe63524fdc6cd94.tar.lz
yuzu-f64d0b3f263c077bc18920f47fe63524fdc6cd94.tar.xz
yuzu-f64d0b3f263c077bc18920f47fe63524fdc6cd94.tar.zst
yuzu-f64d0b3f263c077bc18920f47fe63524fdc6cd94.zip
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/core/hle/kernel/hle_ipc.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/tests/core/hle/kernel/hle_ipc.cpp b/src/tests/core/hle/kernel/hle_ipc.cpp
index e07a28c5b..6feca2ba3 100644
--- a/src/tests/core/hle/kernel/hle_ipc.cpp
+++ b/src/tests/core/hle/kernel/hle_ipc.cpp
@@ -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();