This is an automated email from the ASF dual-hosted git repository.

masaori pushed a commit to branch quic-latest
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/quic-latest by this push:
     new 2f0858e  Fix unit tests for HTTP/3
2f0858e is described below

commit 2f0858e06d40d8315daad4b556eb5727295060fa
Author: Masaori Koshiba <[email protected]>
AuthorDate: Mon Mar 11 13:27:57 2019 +0900

    Fix unit tests for HTTP/3
---
 proxy/http3/Makefile.am        | 56 +++++++++++--------------
 proxy/http3/test/stub.cc       | 94 ------------------------------------------
 proxy/http3/test/test_QPACK.cc |  6 ++-
 3 files changed, 27 insertions(+), 129 deletions(-)

diff --git a/proxy/http3/Makefile.am b/proxy/http3/Makefile.am
index b8d8920..324d88e 100644
--- a/proxy/http3/Makefile.am
+++ b/proxy/http3/Makefile.am
@@ -62,57 +62,47 @@ check_PROGRAMS = \
 
 TESTS = $(check_PROGRAMS)
 
-test_libhttp3_CPPFLAGS = \
+test_CPPFLAGS = \
   $(AM_CPPFLAGS) \
+  -I$(abs_top_srcdir)/proxy/logging \
   -I$(abs_top_srcdir)/tests/include
 
-test_libhttp3_LDFLAGS = \
-  @AM_LDFLAGS@
+test_LDADD = \
+  libhttp3.a \
+  $(top_builddir)/iocore/net/libinknet.a \
+  $(top_builddir)/iocore/net/quic/libquic.a \
+  $(top_builddir)/iocore/eventsystem/libinkevent.a \
+  $(top_builddir)/mgmt/libmgmt_p.la \
+  $(top_builddir)/lib/records/librecords_p.a \
+  $(top_builddir)/src/tscore/libtscore.la \
+  $(top_builddir)/src/tscpp/util/libtscpputil.la \
+  $(top_builddir)/lib/tsconfig/libtsconfig.la \
+  $(top_builddir)/proxy/ParentSelectionStrategy.o \
+  $(top_builddir)/proxy/libproxy.a \
+  $(top_builddir)/proxy/hdrs/libhdrs.a
 
+test_libhttp3_CPPFLAGS = $(test_CPPFLAGS)
+test_libhttp3_LDFLAGS = @AM_LDFLAGS@
+test_libhttp3_LDADD = $(test_LDADD)
 test_libhttp3_SOURCES = \
   ./test/main.cc \
   ./test/test_Http3Frame.cc \
   ../http/HttpConfig.cc \
   ../http/HttpConnectionCount.cc \
   ../http/ForwardedConfig.cc \
-  ./test/stub.cc
-
-test_libhttp3_LDADD = \
-  libhttp3.a \
-  $(top_builddir)/mgmt/libmgmt_p.la \
-  $(top_builddir)/iocore/net/quic/libquic.a \
-  $(top_builddir)/iocore/eventsystem/libinkevent.a \
-  $(top_builddir)/src/tscore/libtscore.la \
-  $(top_builddir)/lib/records/librecords_p.a \
-  $(top_builddir)/proxy/libproxy.a \
-  $(top_builddir)/proxy/hdrs/libhdrs.a \
-  $(top_builddir)/proxy/shared/libUglyLogStubs.a
-
-test_qpack_CPPFLAGS = \
-  $(AM_CPPFLAGS) \
-  -I$(abs_top_srcdir)/tests/include
-
-test_qpack_LDFLAGS = \
-  @AM_LDFLAGS@
+  ../../iocore/net/libinknet_stub.cc
 
+test_qpack_CPPFLAGS = $(test_CPPFLAGS)
+test_qpack_LDFLAGS = @AM_LDFLAGS@
+test_qpack_LDADD = $(test_LDADD)
 test_qpack_SOURCES = \
   ./test/main_qpack.cc \
   ./test/test_QPACK.cc \
   ../http/HttpConfig.cc \
   ../http/HttpConnectionCount.cc \
   ../http/ForwardedConfig.cc \
-  ./test/stub.cc
+  ../../iocore/net/libinknet_stub.cc
 
-test_qpack_LDADD = \
-  libhttp3.a \
-  $(top_builddir)/mgmt/libmgmt_p.la \
-  $(top_builddir)/iocore/net/quic/libquic.a \
-  $(top_builddir)/iocore/eventsystem/libinkevent.a \
-  $(top_builddir)/src/tscore/libtscore.la \
-  $(top_builddir)/lib/records/librecords_p.a \
-  $(top_builddir)/proxy/libproxy.a \
-  $(top_builddir)/proxy/hdrs/libhdrs.a \
-  $(top_builddir)/proxy/shared/libUglyLogStubs.a
 
 #
 # clang-tidy
diff --git a/proxy/http3/test/stub.cc b/proxy/http3/test/stub.cc
deleted file mode 100644
index 6e82100..0000000
--- a/proxy/http3/test/stub.cc
+++ /dev/null
@@ -1,94 +0,0 @@
-/** @file
- *
- *  Stubs for QUICConfig
- *
- *  @section license License
- *
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-#include "tscore/ink_assert.h"
-
-#include "P_SSLConfig.h"
-
-void
-SSLConfigInit(IpMap *)
-{
-  return;
-}
-
-bool
-SSLParseCertificateConfiguration(const SSLConfigParams *, SSL_CTX *)
-{
-  return false;
-}
-
-SSLConfigParams *
-SSLConfig::acquire()
-{
-  return nullptr;
-}
-
-void
-SSLConfig::release(SSLConfigParams *)
-{
-  return;
-}
-
-#include "P_SSLNextProtocolSet.h"
-
-bool
-SSLNextProtocolSet::advertiseProtocols(const unsigned char **out, unsigned 
*len) const
-{
-  return true;
-}
-
-#include "InkAPIInternal.h"
-int
-APIHook::invoke(int, void *)
-{
-  ink_assert(false);
-  return 0;
-}
-
-APIHook *
-APIHook::next() const
-{
-  ink_assert(false);
-  return nullptr;
-}
-
-APIHook *
-APIHooks::get() const
-{
-  ink_assert(false);
-  return nullptr;
-}
-
-void
-APIHooks::clear()
-{
-}
-
-void
-APIHooks::prepend(INKContInternal *cont)
-{
-}
-
-void
-APIHooks::append(INKContInternal *cont)
-{
-}
diff --git a/proxy/http3/test/test_QPACK.cc b/proxy/http3/test/test_QPACK.cc
index c2a1311..1d076fb 100644
--- a/proxy/http3/test/test_QPACK.cc
+++ b/proxy/http3/test/test_QPACK.cc
@@ -64,10 +64,12 @@ private:
   TestQUICConnection _connection;
 };
 
-class TestQUICStream : public QUICStream
+// TODO: QUICUnidirectionalStream should be used if there
+class TestQUICStream : public QUICBidirectionalStream
 {
 public:
-  TestQUICStream(QUICStreamId sid) : QUICStream(new MockQUICRTTProvider(), new 
MockQUICConnectionInfoProvider(), sid, 65536, 65536)
+  TestQUICStream(QUICStreamId sid)
+    : QUICBidirectionalStream(new MockQUICRTTProvider(), new 
MockQUICConnectionInfoProvider(), sid, 65536, 65536)
   {
   }
 

Reply via email to