You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by ma...@apache.org on 2019/04/15 07:17:24 UTC

[trafficserver] branch quic-latest updated: Add stubs for http3 unit tests

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

maskit 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 c0d60aa  Add stubs for http3 unit tests
c0d60aa is described below

commit c0d60aa4b387410152e15f07b37453c49c96270d
Author: Masakazu Kitajo <ma...@apache.org>
AuthorDate: Mon Apr 15 16:16:25 2019 +0900

    Add stubs for http3 unit tests
---
 iocore/net/libinknet_stub.cc |   7 +++
 proxy/http3/Makefile.am      |   5 ++
 proxy/http3/test/stub.cc     | 117 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 129 insertions(+)

diff --git a/iocore/net/libinknet_stub.cc b/iocore/net/libinknet_stub.cc
index 91fbf1f..d821cf8 100644
--- a/iocore/net/libinknet_stub.cc
+++ b/iocore/net/libinknet_stub.cc
@@ -161,3 +161,10 @@ ProcessManager::signalManager(int, char const *, int)
   ink_assert(false);
   return;
 }
+
+void
+ProcessManager::signalManager(int, char const *)
+{
+  ink_assert(false);
+  return;
+}
diff --git a/proxy/http3/Makefile.am b/proxy/http3/Makefile.am
index 5132e45..bccc2d9 100644
--- a/proxy/http3/Makefile.am
+++ b/proxy/http3/Makefile.am
@@ -78,8 +78,11 @@ test_LDADD = \
   $(top_builddir)/src/tscpp/util/libtscpputil.la \
   $(top_builddir)/lib/tsconfig/libtsconfig.la \
   $(top_builddir)/proxy/ParentSelectionStrategy.o \
+  $(top_builddir)/proxy/libhttp2.a \
   $(top_builddir)/proxy/libproxy.a \
   $(top_builddir)/proxy/hdrs/libhdrs.a \
+  @LIBPCRE@ \
+  @OPENSSL_LIBS@ \
   @HWLOC_LIBS@
 
 test_libhttp3_CPPFLAGS = $(test_CPPFLAGS)
@@ -88,6 +91,7 @@ test_libhttp3_LDADD = $(test_LDADD)
 test_libhttp3_SOURCES = \
   ./test/main.cc \
   ./test/test_Http3Frame.cc \
+  ./test/stub.cc \
   ../http/HttpConfig.cc \
   ../http/HttpConnectionCount.cc \
   ../http/ForwardedConfig.cc \
@@ -99,6 +103,7 @@ test_qpack_LDADD = $(test_LDADD)
 test_qpack_SOURCES = \
   ./test/main_qpack.cc \
   ./test/test_QPACK.cc \
+  ./test/stub.cc \
   ../http/HttpConfig.cc \
   ../http/HttpConnectionCount.cc \
   ../http/ForwardedConfig.cc \
diff --git a/proxy/http3/test/stub.cc b/proxy/http3/test/stub.cc
new file mode 100644
index 0000000..cfbf5fb
--- /dev/null
+++ b/proxy/http3/test/stub.cc
@@ -0,0 +1,117 @@
+/** @file
+ *
+ *  A brief file description
+ *
+ *  @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.
+ */
+
+// FIXME: remove stub
+
+#include "I_EventSystem.h"
+#include "InkAPIInternal.h"
+
+void
+APIHooks::clear()
+{
+  ink_abort("do not call stub");
+}
+
+void
+APIHooks::append(INKContInternal *)
+{
+  ink_abort("do not call stub");
+}
+
+void
+APIHooks::prepend(INKContInternal *)
+{
+  ink_abort("do not call stub");
+}
+
+#include "HttpDebugNames.h"
+const char *
+HttpDebugNames::get_api_hook_name(TSHttpHookID t)
+{
+  return "dummy";
+}
+
+#include "HttpSM.h"
+HttpSM::HttpSM() : Continuation(nullptr), vc_table(this) {}
+
+void
+HttpSM::cleanup()
+{
+  ink_abort("do not call stub");
+}
+
+void
+HttpSM::destroy()
+{
+  ink_abort("do not call stub");
+}
+
+void
+HttpSM::set_next_state()
+{
+  ink_abort("do not call stub");
+}
+
+void
+HttpSM::handle_api_return()
+{
+  ink_abort("do not call stub");
+}
+
+int
+HttpSM::kill_this_async_hook(int /* event ATS_UNUSED */, void * /* data ATS_UNUSED */)
+{
+  return EVENT_DONE;
+}
+
+void
+HttpSM::attach_client_session(ProxyClientTransaction *, IOBufferReader *)
+{
+  ink_abort("do not call stub");
+}
+
+void
+HttpSM::init()
+{
+  ink_abort("do not call stub");
+}
+
+ClassAllocator<HttpSM> httpSMAllocator("httpSMAllocator");
+HttpAPIHooks *http_global_hooks;
+
+HttpVCTable::HttpVCTable(HttpSM *) {}
+
+PostDataBuffers::~PostDataBuffers() {}
+
+HttpTunnel::HttpTunnel() : Continuation(nullptr) {}
+HttpTunnelConsumer::HttpTunnelConsumer() {}
+HttpTunnelProducer::HttpTunnelProducer() {}
+ChunkedHandler::ChunkedHandler() {}
+
+HttpCacheSM::HttpCacheSM() {}
+
+HttpCacheAction::HttpCacheAction() : sm(nullptr) {}
+void
+HttpCacheAction::cancel(Continuation *c)
+{
+}