+#define MAX_TEST_LEN 1024
+
+
+// temporary buffers
+static wxChar buf[MAX_TEST_LEN], buf2[MAX_TEST_LEN];
+
+
+// these macros makes it possible to write all tests without repeating a lot of times wxT() macro
+
+#define CMP5(expected, x, y, z, w) \
+ wxSnprintf(buf, MAX_TEST_LEN, wxT(x), y, z, w); \
+ snprintf(buf2, MAX_TEST_LEN, wxT(x), y, z, w); \
+ \
+ CPPUNIT_ASSERT_STR_EQUAL( buf2, buf ); \
+ CPPUNIT_ASSERT_STR_EQUAL( expected, buf );
+
+#define CMP4(expected, x, y, z) \
+ wxSnprintf(buf, MAX_TEST_LEN, wxT(x), y, z); \
+ snprintf(buf2, MAX_TEST_LEN, wxT(x), y, z); \
+ \
+ CPPUNIT_ASSERT_STR_EQUAL( buf2, buf ); \
+ CPPUNIT_ASSERT_STR_EQUAL( expected, buf );
+
+#define CMP3(expected, x, y) \
+ wxSnprintf(buf, MAX_TEST_LEN, wxT(x), y); \
+ snprintf(buf2, MAX_TEST_LEN, wxT(x), y); \
+ \
+ CPPUNIT_ASSERT_STR_EQUAL( buf2, buf ); \
+ CPPUNIT_ASSERT_STR_EQUAL( expected, buf );
+
+#define CMP2(expected, x) \
+ wxSnprintf(buf, MAX_TEST_LEN, wxT(x)); \
+ snprintf(buf2, MAX_TEST_LEN, wxT(x)); \
+ \
+ CPPUNIT_ASSERT_STR_EQUAL( buf2, buf ); \
+ CPPUNIT_ASSERT_STR_EQUAL( expected, buf );
+
+#define CMPTOSIZE(buffer, size, fmt, x, y, z, w) \
+ wxSnprintf(buf, MAX_TEST_LEN, wxT(fmt), x, y, z, w); \
+ snprintf(buf2, MAX_TEST_LEN, wxT(fmt), x, y, z, w); \
+ \
+ CPPUNIT_ASSERT_EQUAL( wxString(buf2, size), wxString(buf, size) );
+