Open GoogleCodeExporter opened 9 years ago
unittest_data.h has two copies of all the data, one in UTF-8 encoding and one
in standard C-string hex escape sequences.
The UTF-8 encoded data is often easier for humans to read. For compilers that
do not support UTF-8 strings, compile with
-Davoid_utf8_string_constants
Did I miss something here, or did you fail to read the comments at the front of
unittest_data.h ? /dick
Original comment by dsi...@google.com
on 23 Oct 2014 at 8:13
I missed the comment at the top of the file. Thanks.
Devil's advocate question:
Given that -Davoid_utf8_string_constants should work on all compilers while the
default (without the define) might break, and that the stated reason for the
UTF-8 is for human readability, why not just turn all the UTF-8 strings into
single-line comments and be done with it? Alternatively, why not invert the
#ifdef logic? There doesn't seem to be an obvious reason to have both copies of
the data at all.
OTOH, we could use the redundant copy to verify that indeed your compiler did
compile the UTF-8 text correctly, i.e. that there is a perfect binary match
between both copies of the string.
My vote would be to invert the ifdef so that the default case works everywhere.
I'll set this back to assigned for now, but change defect to enhancement since
and priority to low since it is working as intended :)
Original comment by andrewha...@google.com
on 24 Oct 2014 at 7:08
Original comment by andrewha...@google.com
on 24 Oct 2014 at 7:08
Original comment by andrewha...@google.com
on 24 Oct 2014 at 7:09
Original issue reported on code.google.com by
andrewha...@google.com
on 26 Aug 2014 at 3:27