mirror of
https://github.com/debauchee/barrier.git
synced 2026-05-09 15:32:41 +08:00
Revert "Made buffer thread wait until there is a GUI client #4721"
This reverts commit 9a4327e44236c0ac30809660dc87a97e984dc84f.
This commit is contained in:
@@ -52,11 +52,11 @@ TEST(IpcLogOutputterTests, write_threadingEnabled_bufferIsSent)
|
||||
|
||||
ON_CALL(mockServer, hasClients(_)).WillByDefault(Return(true));
|
||||
|
||||
EXPECT_CALL(mockServer, hasClients(_)).Times(5);
|
||||
EXPECT_CALL(mockServer, hasClients(_)).Times(2);
|
||||
EXPECT_CALL(mockServer, send(IpcLogLineMessageEq("mock 1\n"), _)).Times(1);
|
||||
EXPECT_CALL(mockServer, send(IpcLogLineMessageEq("mock 2\n"), _)).Times(1);
|
||||
|
||||
IpcLogOutputter outputter(mockServer, kIpcClientUnknown, true);
|
||||
IpcLogOutputter outputter(mockServer, true);
|
||||
outputter.write(kNOTE, "mock 1");
|
||||
mockServer.waitForSend();
|
||||
outputter.write(kNOTE, "mock 2");
|
||||
@@ -68,10 +68,11 @@ TEST(IpcLogOutputterTests, write_overBufferMaxSize_firstLineTruncated)
|
||||
MockIpcServer mockServer;
|
||||
|
||||
ON_CALL(mockServer, hasClients(_)).WillByDefault(Return(true));
|
||||
EXPECT_CALL(mockServer, hasClients(_)).Times(4);
|
||||
|
||||
EXPECT_CALL(mockServer, hasClients(_)).Times(1);
|
||||
EXPECT_CALL(mockServer, send(IpcLogLineMessageEq("mock 2\nmock 3\n"), _)).Times(1);
|
||||
|
||||
IpcLogOutputter outputter(mockServer, kIpcClientUnknown, false);
|
||||
IpcLogOutputter outputter(mockServer, false);
|
||||
outputter.bufferMaxSize(2);
|
||||
|
||||
// log more lines than the buffer can contain
|
||||
@@ -87,10 +88,10 @@ TEST(IpcLogOutputterTests, write_underBufferMaxSize_allLinesAreSent)
|
||||
|
||||
ON_CALL(mockServer, hasClients(_)).WillByDefault(Return(true));
|
||||
|
||||
EXPECT_CALL(mockServer, hasClients(_)).Times(3);
|
||||
EXPECT_CALL(mockServer, hasClients(_)).Times(1);
|
||||
EXPECT_CALL(mockServer, send(IpcLogLineMessageEq("mock 1\nmock 2\n"), _)).Times(1);
|
||||
|
||||
IpcLogOutputter outputter(mockServer, kIpcClientUnknown, false);
|
||||
IpcLogOutputter outputter(mockServer, false);
|
||||
outputter.bufferMaxSize(2);
|
||||
|
||||
// log more lines than the buffer can contain
|
||||
@@ -142,11 +143,11 @@ TEST(IpcLogOutputterTests, write_underBufferRateLimit_allLinesAreSent)
|
||||
|
||||
ON_CALL(mockServer, hasClients(_)).WillByDefault(Return(true));
|
||||
|
||||
EXPECT_CALL(mockServer, hasClients(_)).Times(6);
|
||||
EXPECT_CALL(mockServer, hasClients(_)).Times(2);
|
||||
EXPECT_CALL(mockServer, send(IpcLogLineMessageEq("mock 1\nmock 2\n"), _)).Times(1);
|
||||
EXPECT_CALL(mockServer, send(IpcLogLineMessageEq("mock 3\nmock 4\n"), _)).Times(1);
|
||||
|
||||
IpcLogOutputter outputter(mockServer, kIpcClientUnknown, false);
|
||||
IpcLogOutputter outputter(mockServer, false);
|
||||
outputter.bufferRateLimit(4, 1); // 1s (should be plenty of time)
|
||||
|
||||
// log 1 more line than the buffer can accept in time limit.
|
||||
|
||||
Reference in New Issue
Block a user