Tests: add skeleton for new services kits tests
Change-Id: I759c6b91d3bf856dbbe8b8b6112d53e601798abf
This commit is contained in:
parent
3d2aee7545
commit
892cbe10b6
@ -12,5 +12,6 @@ SimpleTest wlan_test : wlan_test.cpp : $(TARGET_NETWORK_LIBS) bnetapi be ;
|
||||
|
||||
SubInclude HAIKU_TOP src tests kits net cookie ;
|
||||
HaikuSubInclude libnetapi ;
|
||||
SubInclude HAIKU_TOP src tests kits net netservices2 ;
|
||||
SubInclude HAIKU_TOP src tests kits net service ;
|
||||
SubInclude HAIKU_TOP src tests kits net urlRequest ;
|
||||
|
33
src/tests/kits/net/netservices2/HttpTest.cpp
Normal file
33
src/tests/kits/net/netservices2/HttpTest.cpp
Normal file
@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright 2021 Haiku Inc. All rights reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
* Niels Sascha Reedijk, niels.reedijk@gmail.com
|
||||
*/
|
||||
|
||||
#include "HttpTest.h"
|
||||
|
||||
#include <cppunit/TestSuite.h>
|
||||
|
||||
using BPrivate::Network::BHttpSession;
|
||||
|
||||
|
||||
HttpTest::HttpTest(BHttpSession& session)
|
||||
:fSession(session)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* static */ void
|
||||
HttpTest::AddTests(BTestSuite& parent)
|
||||
{
|
||||
CppUnit::TestSuite& suite = *new CppUnit::TestSuite("HttpTest");
|
||||
|
||||
BHttpSession session;
|
||||
|
||||
HttpTest* httpTest = new HttpTest(session);
|
||||
// leak for now
|
||||
parent.addTest("HttpTest", &suite);
|
||||
}
|
27
src/tests/kits/net/netservices2/HttpTest.h
Normal file
27
src/tests/kits/net/netservices2/HttpTest.h
Normal file
@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright 2021 Haiku, inc.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef HTTP_TEST_H
|
||||
#define HTTP_TEST_H
|
||||
|
||||
|
||||
#include <HttpSession.h>
|
||||
#include <TestCase.h>
|
||||
#include <TestSuite.h>
|
||||
|
||||
using BPrivate::Network::BHttpSession;
|
||||
|
||||
|
||||
class HttpTest: public BTestCase {
|
||||
public:
|
||||
HttpTest(BHttpSession& session);
|
||||
|
||||
static void AddTests(BTestSuite& suite);
|
||||
|
||||
private:
|
||||
BHttpSession fSession;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
15
src/tests/kits/net/netservices2/Jamfile
Normal file
15
src/tests/kits/net/netservices2/Jamfile
Normal file
@ -0,0 +1,15 @@
|
||||
SubDir HAIKU_TOP src tests kits net netservices2 ;
|
||||
|
||||
if $(TARGET_PACKAGING_ARCH) != x86_gcc2 {
|
||||
# do not target the legacy platform
|
||||
UsePrivateHeaders netservices2 ;
|
||||
|
||||
UnitTestLib netservicekit2test.so :
|
||||
ServicesKitTestAddon.cpp
|
||||
|
||||
HttpTest.cpp
|
||||
|
||||
: be libnetservices2.a $(TARGET_NETWORK_LIBS) $(HAIKU_NETAPI_LIB)
|
||||
[ TargetLibstdc++ ]
|
||||
;
|
||||
}
|
21
src/tests/kits/net/netservices2/ServicesKitTestAddon.cpp
Normal file
21
src/tests/kits/net/netservices2/ServicesKitTestAddon.cpp
Normal file
@ -0,0 +1,21 @@
|
||||
/*
|
||||
* Copyright 2021 Haiku, Inc.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
|
||||
|
||||
#include <TestSuite.h>
|
||||
#include <TestSuiteAddon.h>
|
||||
|
||||
#include "HttpTest.h"
|
||||
|
||||
|
||||
BTestSuite*
|
||||
getTestSuite()
|
||||
{
|
||||
BTestSuite* suite = new BTestSuite("NetServices2Kit");
|
||||
|
||||
HttpTest::AddTests(*suite);
|
||||
|
||||
return suite;
|
||||
}
|
Loading…
Reference in New Issue
Block a user