+// Print an unsigned character array as a C unsigned character array.
+// NB: Please don't remove this function even though it's not used anywhere,
+// it's very useful when debugging a failed test.
+wxString CByteArrayFormat( const void* data, size_t len, const wxChar* name )
+{
+ const unsigned char* bytes = (unsigned char*)data;
+ wxString result;
+
+ result.Printf( _T("const static unsigned char %s[%i] = \n{"), name, (int)len );
+
+ for ( size_t i = 0; i < len; i++ )
+ {
+ if ( i != 0 )
+ {
+ result.append( _T(",") );
+ }
+ if ((i%16)==0)
+ {
+ result.append( _T("\n ") );
+ }
+ wxString byte = wxString::Format( _T("0x%02x"), bytes[i] );
+ result.append(byte);
+ }
+ result.append( _T("\n};\n") );
+ return result;
+}
+