Add necessary flushes for stream I/O socket writing tests

This commit is contained in:
baldurk
2017-11-27 21:20:28 +00:00
parent 24ef5807e7
commit 05da25a2d7
+6
View File
@@ -137,6 +137,7 @@ TEST_CASE("Test stream I/O operations over the network", "[streamio][network]")
Threading::ThreadHandle sendThread = Threading::CreateThread([&writer]() {
uint32_t pi = 3141592;
writer.Write(pi);
writer.Flush();
});
Threading::Sleep(50);
@@ -193,6 +194,8 @@ TEST_CASE("Test stream I/O operations over the network", "[streamio][network]")
for(int32_t i = 0; i < sz; i++)
writer.Write(list[i]);
writer.Flush();
Atomic::Inc32(&threadB);
});
@@ -237,6 +240,8 @@ TEST_CASE("Test stream I/O operations over the network", "[streamio][network]")
Threading::Sleep(15);
}
writer.Flush();
// close the socket now
sender->Shutdown();
@@ -293,6 +298,7 @@ TEST_CASE("Test stream I/O operations over the network", "[streamio][network]")
int32_t test = 42;
bool success = writer.Write(test);
success &= writer.Flush();
CHECK_FALSE(success);
CHECK(writer.IsErrored());
};