diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:14:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:14:29 +0000 |
commit | fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 (patch) | |
tree | 4c1ccaf5486d4f2009f9a338a98a83e886e29c97 /ipc/ipdl/test/cxx/TestRacyInterruptReplies.cpp | |
parent | Releasing progress-linux version 124.0.1-1~progress7.99u1. (diff) | |
download | firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.tar.xz firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.zip |
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'ipc/ipdl/test/cxx/TestRacyInterruptReplies.cpp')
-rw-r--r-- | ipc/ipdl/test/cxx/TestRacyInterruptReplies.cpp | 94 |
1 files changed, 0 insertions, 94 deletions
diff --git a/ipc/ipdl/test/cxx/TestRacyInterruptReplies.cpp b/ipc/ipdl/test/cxx/TestRacyInterruptReplies.cpp deleted file mode 100644 index cda950b1a1..0000000000 --- a/ipc/ipdl/test/cxx/TestRacyInterruptReplies.cpp +++ /dev/null @@ -1,94 +0,0 @@ -#include "TestRacyInterruptReplies.h" - -#include "IPDLUnitTests.h" // fail etc. - -namespace mozilla { -namespace _ipdltest { - -//----------------------------------------------------------------------------- -// parent - -TestRacyInterruptRepliesParent::TestRacyInterruptRepliesParent() - : mReplyNum(0) { - MOZ_COUNT_CTOR(TestRacyInterruptRepliesParent); -} - -TestRacyInterruptRepliesParent::~TestRacyInterruptRepliesParent() { - MOZ_COUNT_DTOR(TestRacyInterruptRepliesParent); -} - -void TestRacyInterruptRepliesParent::Main() { - int replyNum = -1; - if (!CallR_(&replyNum)) fail("calling R()"); - - if (1 != replyNum) fail("this should have been the first reply to R()"); - - if (!SendChildTest()) fail("sending ChildStart"); -} - -mozilla::ipc::IPCResult TestRacyInterruptRepliesParent::RecvA_() { - int replyNum = -1; - // this R() call races with the reply being generated by the other - // side to the R() call from Main(). This is a pretty nasty edge - // case for which one could argue we're breaking in-order message - // delivery, since this side will process the second reply to R() - // before the first. - if (!CallR_(&replyNum)) fail("calling R()"); - - if (2 != replyNum) fail("this should have been the second reply to R()"); - - return IPC_OK(); -} - -mozilla::ipc::IPCResult TestRacyInterruptRepliesParent::Answer_R( - int* replyNum) { - *replyNum = ++mReplyNum; - - if (1 == *replyNum) - if (!Send_A()) fail("sending _A()"); - - return IPC_OK(); -} - -//----------------------------------------------------------------------------- -// child - -TestRacyInterruptRepliesChild::TestRacyInterruptRepliesChild() : mReplyNum(0) { - MOZ_COUNT_CTOR(TestRacyInterruptRepliesChild); -} - -TestRacyInterruptRepliesChild::~TestRacyInterruptRepliesChild() { - MOZ_COUNT_DTOR(TestRacyInterruptRepliesChild); -} - -mozilla::ipc::IPCResult TestRacyInterruptRepliesChild::AnswerR_(int* replyNum) { - *replyNum = ++mReplyNum; - - if (1 == *replyNum) SendA_(); - - return IPC_OK(); -} - -mozilla::ipc::IPCResult TestRacyInterruptRepliesChild::RecvChildTest() { - int replyNum = -1; - if (!Call_R(&replyNum)) fail("calling R()"); - - if (1 != replyNum) fail("this should have been the first reply to R()"); - - Close(); - - return IPC_OK(); -} - -mozilla::ipc::IPCResult TestRacyInterruptRepliesChild::Recv_A() { - int replyNum = -1; - - if (!Call_R(&replyNum)) fail("calling _R()"); - - if (2 != replyNum) fail("this should have been the second reply to R()"); - - return IPC_OK(); -} - -} // namespace _ipdltest -} // namespace mozilla |