testDiskIO.cc
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
3 *
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
7 */
8
9#include "squid.h"
10#include "compat/cppunit.h"
11#include "DiskIO/DiskIOModule.h"
12#include "HttpHeader.h"
13#include "HttpReply.h"
14#include "MemObject.h"
15#include "Store.h"
16#include "StoreFileSystem.h"
17#include "testStoreSupport.h"
18#include "unitTestMain.h"
19
20#include <stdexcept>
21
22/*
23 * test the DiskIO framework
24 */
25
26class TestDiskIO : public CPPUNIT_NS::TestFixture
27{
31
32protected:
33 void testFindDefault();
34};
35
37
39class MyTestProgram: public TestProgram
40{
41public:
42 /* TestProgram API */
43 void startup() override;
44};
45
46void
48{
49 Mem::Init();
51}
52
53void
55{
57#if USE_DISKIO
58 /* enabled. we expect at least ONE */
59 CPPUNIT_ASSERT(module != nullptr);
60#else
61 /* disabled. we don't expect ANY */
62 CPPUNIT_ASSERT(module == NULL);
63#endif
64}
65
66int
67main(int argc, char *argv[])
68{
69 return MyTestProgram().run(argc, argv);
70}
71
static DiskIOModule * FindDefault()
static void SetupAllModules()
Definition: DiskIOModule.cc:45
customizes our test setup
void startup() override
CPPUNIT_TEST_SUITE_END()
void testFindDefault()
Definition: testDiskIO.cc:54
CPPUNIT_TEST_SUITE(TestDiskIO)
CPPUNIT_TEST(testFindDefault)
implements test program's main() function while enabling customization
Definition: unitTestMain.h:26
int run(int argc, char *argv[])
Definition: unitTestMain.h:44
void Init()
Definition: old_api.cc:425
int main(int argc, char *argv[])
Definition: testDiskIO.cc:67
CPPUNIT_TEST_SUITE_REGISTRATION(TestDiskIO)
#define NULL
Definition: types.h:145

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors