mirror of
https://github.com/pocoproject/poco.git
synced 2025-03-18 11:34:16 +01:00
enh(Net): additional tests for StreamSocket::sendFile()
This commit is contained in:
parent
66c1d30bb4
commit
a1abf9659d
@ -736,7 +736,9 @@ void SocketTest::testSendFile()
|
||||
ostr.close();
|
||||
|
||||
Poco::FileInputStream istr(file.path());
|
||||
ss.sendFile(istr);
|
||||
std::streamsize n = ss.sendFile(istr);
|
||||
assertTrue (n == file.getSize());
|
||||
|
||||
istr.close();
|
||||
ss.close();
|
||||
|
||||
@ -771,7 +773,9 @@ void SocketTest::testSendFileLarge()
|
||||
ostr.close();
|
||||
|
||||
Poco::FileInputStream istr(file.path());
|
||||
ss.sendFile(istr);
|
||||
std::streamsize n = ss.sendFile(istr);
|
||||
assertTrue (n == file.getSize());
|
||||
|
||||
istr.close();
|
||||
ss.close();
|
||||
|
||||
@ -809,7 +813,9 @@ void SocketTest::testSendFileRange()
|
||||
const std::streamsize count = 10000;
|
||||
|
||||
Poco::FileInputStream istr(file.path());
|
||||
ss.sendFile(istr, offset, count);
|
||||
std::streamsize n = ss.sendFile(istr, offset, count);
|
||||
assertTrue (n == count);
|
||||
|
||||
istr.close();
|
||||
ss.close();
|
||||
|
||||
|
@ -259,7 +259,9 @@ void SecureStreamSocketTest::testSendFile()
|
||||
ostr.close();
|
||||
|
||||
Poco::FileInputStream istr(file.path());
|
||||
ss.sendFile(istr);
|
||||
std::streamsize n = ss.sendFile(istr);
|
||||
assertTrue (n == file.getSize());
|
||||
|
||||
istr.close();
|
||||
ss.close();
|
||||
|
||||
@ -294,7 +296,9 @@ void SecureStreamSocketTest::testSendFileLarge()
|
||||
ostr.close();
|
||||
|
||||
Poco::FileInputStream istr(file.path());
|
||||
ss.sendFile(istr);
|
||||
std::streamsize n = ss.sendFile(istr);
|
||||
assertTrue (n == file.getSize());
|
||||
|
||||
istr.close();
|
||||
ss.close();
|
||||
|
||||
@ -332,7 +336,9 @@ void SecureStreamSocketTest::testSendFileRange()
|
||||
const std::streamsize count = 10000;
|
||||
|
||||
Poco::FileInputStream istr(file.path());
|
||||
ss.sendFile(istr, offset, count);
|
||||
std::streamsize n = ss.sendFile(istr, offset, count);
|
||||
assertTrue (n == count);
|
||||
|
||||
istr.close();
|
||||
ss.close();
|
||||
|
||||
@ -341,9 +347,6 @@ void SecureStreamSocketTest::testSendFileRange()
|
||||
Poco::Thread::sleep(100);
|
||||
}
|
||||
|
||||
std::cout << "\n" << fileData.size() << std::endl;
|
||||
std::cout << "\n" << CopyToStringConnection::data().size() << std::endl;
|
||||
|
||||
assertTrue (CopyToStringConnection::data() == fileData.substr(offset, count));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user