Skip to content

Commit e18bb8b

Browse files
committed
Separate stubs for libinknet from test_I_UDPNet.cc
1 parent 532fa0d commit e18bb8b

File tree

3 files changed

+163
-142
lines changed

3 files changed

+163
-142
lines changed

iocore/net/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ test_UDPNet_LDADD = \
7878
@HWLOC_LIBS@ @OPENSSL_LIBS@ @LIBPCRE@ @YAMLCPP_LIBS@
7979

8080
test_UDPNet_SOURCES = \
81+
libinknet_stub.cc \
8182
test_I_UDPNet.cc
8283

8384
libinknet_a_SOURCES = \

iocore/net/libinknet_stub.cc

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
/** @file
2+
3+
Stub file for linking libinknet.a from unit tests
4+
5+
@section license License
6+
7+
Licensed to the Apache Software Foundation (ASF) under one
8+
or more contributor license agreements. See the NOTICE file
9+
distributed with this work for additional information
10+
regarding copyright ownership. The ASF licenses this file
11+
to you under the Apache License, Version 2.0 (the
12+
"License"); you may not use this file except in compliance
13+
with the License. You may obtain a copy of the License at
14+
15+
http://www.apache.org/licenses/LICENSE-2.0
16+
17+
Unless required by applicable law or agreed to in writing, software
18+
distributed under the License is distributed on an "AS IS" BASIS,
19+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20+
See the License for the specific language governing permissions and
21+
limitations under the License.
22+
*/
23+
24+
#include "HttpSessionManager.h"
25+
void
26+
initialize_thread_for_http_sessions(EThread *, int)
27+
{
28+
ink_assert(false);
29+
}
30+
31+
#include "P_UnixNet.h"
32+
#include "P_DNSConnection.h"
33+
int
34+
DNSConnection::close()
35+
{
36+
ink_assert(false);
37+
return 0;
38+
}
39+
40+
void
41+
DNSConnection::trigger()
42+
{
43+
ink_assert(false);
44+
}
45+
46+
#include "StatPages.h"
47+
void
48+
StatPagesManager::register_http(char const *, Action *(*)(Continuation *, HTTPHdr *))
49+
{
50+
ink_assert(false);
51+
}
52+
53+
#include "ParentSelection.h"
54+
void
55+
SocksServerConfig::startup()
56+
{
57+
ink_assert(false);
58+
}
59+
60+
int SocksServerConfig::m_id = 0;
61+
62+
void
63+
ParentConfigParams::findParent(HttpRequestData *, ParentResult *, unsigned int, unsigned int)
64+
{
65+
ink_assert(false);
66+
}
67+
68+
void
69+
ParentConfigParams::nextParent(HttpRequestData *, ParentResult *, unsigned int, unsigned int)
70+
{
71+
ink_assert(false);
72+
}
73+
74+
#include "Log.h"
75+
void
76+
Log::trace_in(sockaddr const *, unsigned short, char const *, ...)
77+
{
78+
ink_assert(false);
79+
}
80+
81+
void
82+
Log::trace_out(sockaddr const *, unsigned short, char const *, ...)
83+
{
84+
ink_assert(false);
85+
}
86+
87+
#include "InkAPIInternal.h"
88+
int
89+
APIHook::invoke(int, void *)
90+
{
91+
ink_assert(false);
92+
return 0;
93+
}
94+
95+
APIHook *
96+
APIHook::next() const
97+
{
98+
ink_assert(false);
99+
return nullptr;
100+
}
101+
102+
APIHook *
103+
APIHooks::get() const
104+
{
105+
ink_assert(false);
106+
return nullptr;
107+
}
108+
109+
void
110+
ConfigUpdateCbTable::invoke(const char * /* name ATS_UNUSED */)
111+
{
112+
ink_release_assert(false);
113+
}
114+
115+
#include "ControlMatcher.h"
116+
char *
117+
HttpRequestData::get_string()
118+
{
119+
ink_assert(false);
120+
return nullptr;
121+
}
122+
123+
const char *
124+
HttpRequestData::get_host()
125+
{
126+
ink_assert(false);
127+
return nullptr;
128+
}
129+
130+
sockaddr const *
131+
HttpRequestData::get_ip()
132+
{
133+
ink_assert(false);
134+
return nullptr;
135+
}
136+
137+
sockaddr const *
138+
HttpRequestData::get_client_ip()
139+
{
140+
ink_assert(false);
141+
return nullptr;
142+
}
143+
144+
SslAPIHooks *ssl_hooks = nullptr;
145+
StatPagesManager statPagesManager;
146+
147+
#include "ProcessManager.h"
148+
inkcoreapi ProcessManager *pmgmt = nullptr;
149+
150+
int
151+
BaseManager::registerMgmtCallback(int, MgmtCallback const &)
152+
{
153+
ink_assert(false);
154+
return 0;
155+
}
156+
157+
void
158+
ProcessManager::signalManager(int, char const *, int)
159+
{
160+
ink_assert(false);
161+
return;
162+
}

iocore/net/test_I_UDPNet.cc

Lines changed: 0 additions & 142 deletions
Original file line numberDiff line numberDiff line change
@@ -232,145 +232,3 @@ main(int /* argc ATS_UNUSED */, const char ** /* argv ATS_UNUSED */)
232232
RegressionTest::run("UDPNet", REGRESSION_TEST_QUICK);
233233
return RegressionTest::final_status == REGRESSION_TEST_PASSED ? 0 : 1;
234234
}
235-
236-
//
237-
// stub
238-
//
239-
void
240-
initialize_thread_for_http_sessions(EThread *, int)
241-
{
242-
ink_assert(false);
243-
}
244-
245-
#include "P_UnixNet.h"
246-
#include "P_DNSConnection.h"
247-
int
248-
DNSConnection::close()
249-
{
250-
ink_assert(false);
251-
return 0;
252-
}
253-
254-
void
255-
DNSConnection::trigger()
256-
{
257-
ink_assert(false);
258-
}
259-
260-
#include "StatPages.h"
261-
void
262-
StatPagesManager::register_http(char const *, Action *(*)(Continuation *, HTTPHdr *))
263-
{
264-
ink_assert(false);
265-
}
266-
267-
#include "ParentSelection.h"
268-
void
269-
SocksServerConfig::startup()
270-
{
271-
ink_assert(false);
272-
}
273-
274-
int SocksServerConfig::m_id = 0;
275-
276-
void
277-
ParentConfigParams::findParent(HttpRequestData *, ParentResult *, unsigned int, unsigned int)
278-
{
279-
ink_assert(false);
280-
}
281-
282-
void
283-
ParentConfigParams::nextParent(HttpRequestData *, ParentResult *, unsigned int, unsigned int)
284-
{
285-
ink_assert(false);
286-
}
287-
288-
#include "Log.h"
289-
void
290-
Log::trace_in(sockaddr const *, unsigned short, char const *, ...)
291-
{
292-
ink_assert(false);
293-
}
294-
295-
void
296-
Log::trace_out(sockaddr const *, unsigned short, char const *, ...)
297-
{
298-
ink_assert(false);
299-
}
300-
301-
#include "InkAPIInternal.h"
302-
int
303-
APIHook::invoke(int, void *)
304-
{
305-
ink_assert(false);
306-
return 0;
307-
}
308-
309-
APIHook *
310-
APIHook::next() const
311-
{
312-
ink_assert(false);
313-
return nullptr;
314-
}
315-
316-
APIHook *
317-
APIHooks::get() const
318-
{
319-
ink_assert(false);
320-
return nullptr;
321-
}
322-
323-
void
324-
ConfigUpdateCbTable::invoke(const char * /* name ATS_UNUSED */)
325-
{
326-
ink_release_assert(false);
327-
}
328-
329-
#include "ControlMatcher.h"
330-
char *
331-
HttpRequestData::get_string()
332-
{
333-
ink_assert(false);
334-
return nullptr;
335-
}
336-
337-
const char *
338-
HttpRequestData::get_host()
339-
{
340-
ink_assert(false);
341-
return nullptr;
342-
}
343-
344-
sockaddr const *
345-
HttpRequestData::get_ip()
346-
{
347-
ink_assert(false);
348-
return nullptr;
349-
}
350-
351-
sockaddr const *
352-
HttpRequestData::get_client_ip()
353-
{
354-
ink_assert(false);
355-
return nullptr;
356-
}
357-
358-
SslAPIHooks *ssl_hooks = nullptr;
359-
StatPagesManager statPagesManager;
360-
361-
#include "ProcessManager.h"
362-
inkcoreapi ProcessManager *pmgmt = nullptr;
363-
364-
int
365-
BaseManager::registerMgmtCallback(int, MgmtCallback const &)
366-
{
367-
ink_assert(false);
368-
return 0;
369-
}
370-
371-
void
372-
ProcessManager::signalManager(int, char const *, int)
373-
{
374-
ink_assert(false);
375-
return;
376-
}

0 commit comments

Comments
 (0)