test/cxx/EventedClientTest.cpp in passenger-3.9.1.beta vs test/cxx/EventedClientTest.cpp in passenger-3.9.2.beta

- old
+ new

@@ -1,9 +1,9 @@ -#include "TestSupport.h" -#include "EventedClient.h" -#include "Utils/ScopeGuard.h" -#include "Utils/IOUtils.h" +#include <TestSupport.h> +#include <EventedClient.h> +#include <Utils/ScopeGuard.h> +#include <Utils/IOUtils.h> #include <oxt/thread.hpp> using namespace Passenger; using namespace std; @@ -414,28 +414,28 @@ TEST_METHOD(17) { // EventedClient.write() ensures that the given data is written // after what's already in the outbox. EventedClient client(eventLoop, fd2); string header(1024 * 4, 'x'); - string body(1024 * 128, 'y'); + string body(1024 * 1024, 'y'); char buf[header.size() + body.size() + 1024]; client.write(header); client.write(body); - ensure(client.pendingWrites() > 0); + ensure("(1)", client.pendingWrites() > 0); - ensure_equals(readExact(fd1, buf, header.size()), (unsigned int) header.size()); - ensure_equals(StaticString(buf, header.size()), header); + ensure_equals("(2)", readExact(fd1, buf, header.size()), (unsigned int) header.size()); + ensure_equals("(3)", StaticString(buf, header.size()), header); client.write("hello world"); startEventLoop(); EVENT_LOOP_GUARD; unsigned int len = body.size() + strlen("hello world"); - ensure_equals(readExact(fd1, buf, len), len); - ensure_equals(StaticString(buf, len), body + "hello world"); + ensure_equals("(4)", readExact(fd1, buf, len), len); + ensure_equals("(5)", StaticString(buf, len), body + "hello world"); } TEST_METHOD(18) { // If writeErrorAction is DISCONNECT_FULL then // EventedClient.write(), upon encountering a write error, @@ -457,21 +457,21 @@ EventedClient client(eventLoop, fd2); client.userData = this; client.writeErrorAction = EventedClient::DISCONNECT_FULL; client.onSystemError = saveSystemError; - string str(1024 * 128, 'x'); + string str(1024 * 1024, 'x'); client.write(str); - ensure(client.pendingWrites() > 0); + ensure("(1)", client.pendingWrites() > 0); fd1.close(); client.onDisconnect = exitEventLoop; startEventLoop(); waitUntilEventLoopExits(); - ensure_equals(lastErrorCode, EPIPE); - ensure_equals(client.fd, -1); + ensure_equals("(2)", lastErrorCode, EPIPE); + ensure_equals("(3)", client.fd, -1); } TEST_METHOD(20) { // If writeErrorAction is DISCONNECT_WRITE then // EventedClient.write(), upon encountering a write error, @@ -505,19 +505,19 @@ client.writeErrorAction = EventedClient::DISCONNECT_WRITE; client.onSystemError = saveSystemError; client.onReadable = readAndExitOnEof; client.notifyReads(true); - string str(1024 * 128, 'x'); + string str(1024 * 1024, 'x'); client.write(str); - ensure(client.pendingWrites() > 0); + ensure("(1)", client.pendingWrites() > 0); writeExact(fd1, "world", 5); fd1.close(); startEventLoop(); waitUntilEventLoopExits(); - ensure(client.fd != -1); - ensure_equals(data, "world"); + ensure("(2)", client.fd != -1); + ensure_equals("(3)", data, "world"); } }