Merge "Revert "tests/filetransfer: reënable on Darwin"" into main
This commit is contained in:
commit
2f104bbe3b
|
@ -13,6 +13,14 @@
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
// local server tests don't work on darwin without some incantations
|
||||||
|
// the horrors do not want to look up. contributions welcome though!
|
||||||
|
#if __APPLE__
|
||||||
|
#define NOT_ON_DARWIN(n) DISABLED_##n
|
||||||
|
#else
|
||||||
|
#define NOT_ON_DARWIN(n) n
|
||||||
|
#endif
|
||||||
|
|
||||||
using namespace std::chrono_literals;
|
using namespace std::chrono_literals;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
@ -142,7 +150,7 @@ TEST(FileTransfer, exceptionAbortsDownload)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(FileTransfer, reportsSetupErrors)
|
TEST(FileTransfer, NOT_ON_DARWIN(reportsSetupErrors))
|
||||||
{
|
{
|
||||||
auto [port, srv] = serveHTTP("404 not found", "", [] { return ""; });
|
auto [port, srv] = serveHTTP("404 not found", "", [] { return ""; });
|
||||||
auto ft = makeFileTransfer();
|
auto ft = makeFileTransfer();
|
||||||
|
@ -151,7 +159,7 @@ TEST(FileTransfer, reportsSetupErrors)
|
||||||
FileTransferError);
|
FileTransferError);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(FileTransfer, reportsTransferError)
|
TEST(FileTransfer, NOT_ON_DARWIN(reportsTransferError))
|
||||||
{
|
{
|
||||||
auto [port, srv] = serveHTTP("200 ok", "content-length: 100\r\n", [] {
|
auto [port, srv] = serveHTTP("200 ok", "content-length: 100\r\n", [] {
|
||||||
std::this_thread::sleep_for(10ms);
|
std::this_thread::sleep_for(10ms);
|
||||||
|
@ -163,7 +171,7 @@ TEST(FileTransfer, reportsTransferError)
|
||||||
ASSERT_THROW(ft->download(req), FileTransferError);
|
ASSERT_THROW(ft->download(req), FileTransferError);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(FileTransfer, handlesContentEncoding)
|
TEST(FileTransfer, NOT_ON_DARWIN(handlesContentEncoding))
|
||||||
{
|
{
|
||||||
std::string original = "Test data string";
|
std::string original = "Test data string";
|
||||||
std::string compressed = compress("gzip", original);
|
std::string compressed = compress("gzip", original);
|
||||||
|
|
Loading…
Reference in a new issue