From d3dd07ccf2e977a78f536474a6041fd7bf16924d Mon Sep 17 00:00:00 2001 From: Masakazu Kitajo Date: Fri, 13 Jan 2023 09:24:43 -0700 Subject: [PATCH 1/2] Fix build issues in H3 unit tests --- iocore/net/quic/Mock.h | 15 +++++++++++++++ proxy/http3/test/test_QPACK.cc | 8 ++++++++ 2 files changed, 23 insertions(+) diff --git a/iocore/net/quic/Mock.h b/iocore/net/quic/Mock.h index a7c17861900..a2f251618a5 100644 --- a/iocore/net/quic/Mock.h +++ b/iocore/net/quic/Mock.h @@ -27,7 +27,11 @@ #include "QUICApplication.h" #include "QUICStreamManager.h" +#if HAVE_QUICHE_H +#include "QUICStreamManager_quiche.h" +#else #include "QUICStreamManager_native.h" +#endif #include "QUICLossDetector.h" #include "QUICPacketProtectionKeyInfo.h" #include "QUICPinger.h" @@ -39,6 +43,11 @@ #include "QUICPadder.h" #include "QUICHandshakeProtocol.h" #include "QUICStreamAdapter.h" +#if HAVE_QUICHE_H +#include "QUICStream_quiche.h" +#else +#include "QUICStream_native.h" +#endif class MockQUICContext; @@ -246,6 +255,8 @@ class MockQUICStreamManager : public QUICStreamManagerImpl MockQUICStreamManager(QUICContext *context) : QUICStreamManagerImpl(context, nullptr) {} // Override +#if HAVE_QUICHE_H +#else virtual QUICConnectionErrorUPtr handle_frame(QUICEncryptionLevel level, const QUICFrame &f) override { @@ -254,6 +265,7 @@ class MockQUICStreamManager : public QUICStreamManagerImpl return nullptr; } +#endif // for Test int @@ -652,6 +664,8 @@ class MockQUICContext : public QUICContext { return _config; } +#if HAVE_QUICHE_H +#else virtual QUICRTTProvider * rtt_provider() const override { @@ -681,6 +695,7 @@ class MockQUICContext : public QUICContext { return _path_manager.get(); } +#endif private: QUICConfig::scoped_config _config; diff --git a/proxy/http3/test/test_QPACK.cc b/proxy/http3/test/test_QPACK.cc index 178a6e3cea5..6de8e189cd8 100644 --- a/proxy/http3/test/test_QPACK.cc +++ b/proxy/http3/test/test_QPACK.cc @@ -65,11 +65,19 @@ class QUICApplicationDriver }; // TODO: QUICUnidirectionalStream should be used if there +#if HAVE_QUICHE_H +class TestQUICStream : public QUICStreamImpl +#else class TestQUICStream : public QUICBidirectionalStream +#endif { public: TestQUICStream(QUICStreamId sid) +#if HAVE_QUICHE_H + : QUICStreamImpl(new MockQUICConnectionInfoProvider(), sid) +#else : QUICBidirectionalStream(new MockQUICRTTProvider(), new MockQUICConnectionInfoProvider(), sid, 65536, 65536) +#endif { } From 76980f23ae88b09fee76285fa3b47bfafa381b31 Mon Sep 17 00:00:00 2001 From: Masakazu Kitajo Date: Fri, 13 Jan 2023 11:39:22 -0700 Subject: [PATCH 2/2] Use ifndef --- iocore/net/quic/Mock.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/iocore/net/quic/Mock.h b/iocore/net/quic/Mock.h index a2f251618a5..3b0b31e26da 100644 --- a/iocore/net/quic/Mock.h +++ b/iocore/net/quic/Mock.h @@ -255,8 +255,7 @@ class MockQUICStreamManager : public QUICStreamManagerImpl MockQUICStreamManager(QUICContext *context) : QUICStreamManagerImpl(context, nullptr) {} // Override -#if HAVE_QUICHE_H -#else +#ifndef HAVE_QUICHE_H virtual QUICConnectionErrorUPtr handle_frame(QUICEncryptionLevel level, const QUICFrame &f) override { @@ -664,8 +663,7 @@ class MockQUICContext : public QUICContext { return _config; } -#if HAVE_QUICHE_H -#else +#ifndef HAVE_QUICHE_H virtual QUICRTTProvider * rtt_provider() const override {