// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
-#include "wx/wxprec.h"
+#include "testprec.h"
#ifdef __BORLANDC__
# pragma hdrstop
#include "wx/mstream.h"
#include "wx/wfstream.h"
#include "wx/dir.h"
-#include "wx/cppunit.h"
#include <string>
#include <list>
#include <sys/stat.h>
{
public:
TestEntry(const wxDateTime& dt, int len, const char *data);
- ~TestEntry() { delete [] m_data; }
+ ~TestEntry() { delete [] (char*) m_data; }
wxDateTime GetDateTime() const { return m_dt; }
wxFileOffset GetLength() const { return m_len; }
TestInputStream(TestOutputStream& out) : m_data(NULL) { SetData(out); }
// this ctor 'dups'
TestInputStream(const TestInputStream& in);
- ~TestInputStream() { delete [] m_data; }
+ ~TestInputStream() { delete [] (char*) m_data; }
void Rewind();
wxFileOffset GetLength() const { return m_size; }
void TestInputStream::SetData(TestOutputStream& out)
{
- delete [] m_data;
+ delete [] (char*) m_data;
m_options = out.GetOptions();
out.GetData(m_data, m_size);
Rewind();
template <class Classes>
ArchiveTestCase<Classes>::ArchiveTestCase(const wxString& name,
- int id,
- ClassFactoryT *factory,
- int options,
- const wxString& archiver,
- const wxString& unarchiver)
- : CppUnit::TestCase(std::string(name.mb_str())),
- m_factory(factory),
- m_options(options),
- m_timeStamp(1, wxDateTime::Mar, 2005, 12, 0),
- m_id(id),
- m_archiver(archiver),
- m_unarchiver(unarchiver)
+ int id,
+ typename Classes::ClassFactoryT *factory,
+ int options,
+ const wxString& archiver,
+ const wxString& unarchiver)
+ : CppUnit::TestCase(std::string(name.mb_str())),
+ m_factory(factory),
+ m_options(options),
+ m_timeStamp(1, wxDateTime::Mar, 2005, 12, 0),
+ m_id(id),
+ m_archiver(archiver),
+ m_unarchiver(unarchiver)
{
}
-
+
template <class Classes>
ArchiveTestCase<Classes>::~ArchiveTestCase()
{
it != m_testEntries.end());
const TestEntry& testEntry = *it->second;
- size_t size = 0;
#ifndef __WXMSW__
CPPUNIT_ASSERT_MESSAGE("timestamp check" + error_context,
CPPUNIT_ASSERT_MESSAGE(
"entry not found in archive" + error_entry, in.Ok());
- size = in.GetLength();
+ size_t size = in.GetLength();
wxCharBuffer buf(size);
CPPUNIT_ASSERT_MESSAGE("Read" + error_context,
in.Read(buf.data(), size).LastRead() == size);