wxwidgets/tests/archive/tartest.cpp
Vadim Zeitlin 4f4c5fcfdf Use nullptr instead of NULL in the code and documentation
This is a combination of running clang-tidy with modernize-use-nullptr
check for some ports (GTK, X11, OSX) and manual changes to the ports for
which it couldn't be used easily (MSW, DFB) and also manually updating
the docs.

Also replace NULL with null or nullptr in the comments as this is more
consistent with the use of nullptr in the code and makes it simpler to
grep for the remaining occurrences of NULL itself.

And also use null in the assert messages.

Only a few occurrences of "NULL" are still left in non-C files, mostly
corresponding to unclear comments or string output which it might not be
safe to change.
2022-10-18 01:25:25 +02:00

72 lines
1.8 KiB
C++

///////////////////////////////////////////////////////////////////////////////
// Name: tests/tartest.cpp
// Purpose: Test the tar classes
// Author: Mike Wetherell
// Copyright: (c) 2004 Mike Wetherell
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#include "testprec.h"
#ifndef WX_PRECOMP
# include "wx/wx.h"
#endif
#if wxUSE_STREAMS
#include "archivetest.h"
#include "wx/tarstrm.h"
using std::string;
///////////////////////////////////////////////////////////////////////////////
// Tar suite
class tartest : public ArchiveTestSuite
{
public:
tartest();
void runTest() override { DoRunTest(); }
protected:
CppUnit::Test *makeTest(string descr, int options,
bool genericInterface,
const wxString& archiver,
const wxString& unarchiver) override;
};
tartest::tartest()
: ArchiveTestSuite("tar")
{
AddArchiver(wxT("tar cf %s *"));
AddUnArchiver(wxT("tar xf %s"));
}
CppUnit::Test *tartest::makeTest(
string descr,
int options,
bool genericInterface,
const wxString& archiver,
const wxString& unarchiver)
{
if ((options & Stub) && (options & PipeIn) == 0)
return nullptr;
if (genericInterface)
{
return new ArchiveTestCase<wxArchiveClassFactory>(
descr, new wxTarClassFactory,
options, archiver, unarchiver);
}
return new ArchiveTestCase<wxTarClassFactory>(
descr, new wxTarClassFactory,
options, archiver, unarchiver);
}
CPPUNIT_TEST_SUITE_REGISTRATION(tartest);
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(tartest, "archive/tar");
#endif // wxUSE_STREAMS