From b80da783a13c73149afd9d6f6916f1a343164489 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 13 Sep 2025 15:41:57 +0200 Subject: [PATCH] Allow specifying initial contents of TestFile This will be used in the next commit. --- tests/testfile.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/testfile.h b/tests/testfile.h index 9c1f5afa3d..c41c916b01 100644 --- a/tests/testfile.h +++ b/tests/testfile.h @@ -27,11 +27,12 @@ inline std::ostream& operator<<(std::ostream& o, const wxFileName& fn) class TestFile { public: - TestFile() + // Ctor creates the file and initializes with the provided temporary data. + explicit TestFile(const void* data = "Before", size_t size = 6) { wxFile file; m_name = wxFileName::CreateTempFileName(wxT("wxtest"), &file); - file.Write("Before", 6); + file.Write(data, size); } ~TestFile() { if (wxFileExists(m_name)) wxRemoveFile(m_name); }