bustage: mfbt/tests/TestJSONWriter.cpp(300) : error C2143: syntax error : missing ';' before ':'

RESOLVED FIXED in mozilla35

Status

()

defect
--
blocker
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: masayuki, Assigned: masayuki)

Tracking

({regression})

Trunk
mozilla35
x86_64
Windows 8.1
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite -
qe-verify -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

>  0:43.25 TestJSONWriter.cpp
>  0:43.25 a:/mozilla/mc-c/src/mfbt/tests/TestJSONWriter.cpp(300) : error C2143: syntax error : missing ';' before ':'
>  0:43.25 a:/mozilla/mc-c/src/mfbt/tests/TestJSONWriter.cpp(300) : error C2143: syntax error : missing ';' before ':'
>  0:43.25 a:/mozilla/mc-c/src/mfbt/tests/TestJSONWriter.cpp(300) : error C2017: illegal escape sequence
>  0:43.25 a:/mozilla/mc-c/src/mfbt/tests/TestJSONWriter.cpp(301) : error C2017: illegal escape sequence
>  0:43.25 a:/mozilla/mc-c/src/mfbt/tests/TestJSONWriter.cpp(303) : error C2017: illegal escape sequence
>  0:43.25 a:/mozilla/mc-c/src/mfbt/tests/TestJSONWriter.cpp(304) : error C2017: illegal escape sequence
>  0:43.25 a:/mozilla/mc-c/src/mfbt/tests/TestJSONWriter.cpp(306) : error C2017: illegal escape sequence
>  0:43.25 a:/mozilla/mc-c/src/mfbt/tests/TestJSONWriter.cpp(307) : error C2017: illegal escape sequence
>  0:43.25 a:/mozilla/mc-c/src/mfbt/tests/TestJSONWriter.cpp(308) : error C2017: illegal escape sequence
>  0:43.25 a:/mozilla/mc-c/src/mfbt/tests/TestJSONWriter.cpp(309) : error C2143: syntax error : missing ';' before '}'
>  0:43.25 a:/mozilla/mc-c/src/mfbt/tests/TestJSONWriter.cpp(309) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
>  0:43.25 a:/mozilla/mc-c/src/mfbt/tests/TestJSONWriter.cpp(309) : error C2143: syntax error : missing ';' before '}'
>  0:43.25 a:/mozilla/mc-c/src/mfbt/tests/TestJSONWriter.cpp(309) : error C2059: syntax error : '}'
>  0:43.25 a:/mozilla/mc-c/src/mfbt/tests/TestJSONWriter.cpp(309) : error C2017: illegal escape sequence
>  0:43.25 a:/mozilla/mc-c/src/mfbt/tests/TestJSONWriter.cpp(310) : error C2001: newline in constant
>  0:43.25 a:/mozilla/mc-c/src/mfbt/tests/TestJSONWriter.cpp(315) : error C2143: syntax error : missing ';' before '.'
>  0:43.26 a:/mozilla/mc-c/src/mfbt/tests/TestJSONWriter.cpp(315) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
>  0:43.26 a:/mozilla/mc-c/src/mfbt/tests/TestJSONWriter.cpp(316) : error C2447: '{' : missing function header (old-style formal list?)
>  0:43.26 a:/mozilla/mc-c/src/mfbt/tests/TestJSONWriter.cpp(326) : error C2001: newline in constant
>  0:43.26 a:/mozilla/mc-c/src/mfbt/tests/TestJSONWriter.cpp(329) : error C2001: newline in constant
>  0:43.26 a:/mozilla/mc-c/src/mfbt/tests/TestJSONWriter.cpp(333) : error C2001: newline in constant
>  0:43.26 a:/mozilla/mc-c/src/mfbt/tests/TestJSONWriter.cpp(338) : error C2143: syntax error : missing ';' before '.'
>  0:43.26 a:/mozilla/mc-c/src/mfbt/tests/TestJSONWriter.cpp(338) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
>  0:43.26 a:/mozilla/mc-c/src/mfbt/tests/TestJSONWriter.cpp(338) : error C2086: 'int w' : redefinition
>  0:43.26         a:/mozilla/mc-c/src/mfbt/tests/TestJSONWriter.cpp(315) : see declaration of 'w'
>  0:43.26 a:/mozilla/mc-c/src/mfbt/tests/TestJSONWriter.cpp(340) : error C2228: left of '.WriteFunc' must have class/struct/union
>  0:43.26         type is 'int'
>  0:43.26 a:/mozilla/mc-c/src/mfbt/tests/TestJSONWriter.cpp(340) : error C2065: 'expected' : undeclared identifier
>  0:43.26 a:/mozilla/mc-c/src/mfbt/tests/TestJSONWriter.cpp(340) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
>  0:43.26 a:/mozilla/mc-c/src/mfbt/tests/TestJSONWriter.cpp(340) : error C2365: 'Check' : redefinition; previous definition was 'function'
>  0:43.26         a:/mozilla/mc-c/src/mfbt/tests/TestJSONWriter.cpp(37) : see declaration of 'Check'
>  0:43.26 a:/mozilla/mc-c/src/mfbt/tests/TestJSONWriter.cpp(340) : error C2078: too many initializers
>  0:43.26 a:/mozilla/mc-c/src/mfbt/tests/TestJSONWriter.cpp(341) : error C2059: syntax error : '}'
>  0:43.26 a:/mozilla/mc-c/src/mfbt/tests/TestJSONWriter.cpp(341) : error C2143: syntax error : missing ';' before '}'
>  0:43.26 a:/mozilla/mc-c/src/mfbt/tests/TestJSONWriter.cpp(341) : error C2059: syntax error : '}'
>  0:43.26 a:/mozilla/mc-c/src/mfbt/tests/TestJSONWriter.cpp(344) : error C2143: syntax error : missing ';' before '{'
>  0:43.26 a:/mozilla/mc-c/src/mfbt/tests/TestJSONWriter.cpp(344) : error C2447: '{' : missing function header (old-style formal list?)
>  0:43.26 a:/mozilla/mc-c/src/mfbt/tests/TestJSONWriter.cpp(414) : error C3861: 'TestDeepNesting': identifier not found

The code is here:

> 295 void TestStringEscaping()
> 296 {
> 297   const char* expected = "\
> 298 {\n\
> 299  \"ascii\": \"~}|{zyxwvutsrqponmlkjihgfedcba`_^]\\\\[ZYXWVUTSRQPONMLKJIHGFEDCBA@?>=<;:9876543210/.-,+*)('&%$#\\\"! \\u001f\\u001e\\u001d\\u001c\\u001b\\u001a\\u0019\\u0018\\u0017\\u0016\\u0015\\u0014\\u0013\\u0012\\u0011\\u0010\\u000f\\u000e\\r\\f\\u000b\\n\\t\\b\\u0007\\u0006\\u0005\\u0004\\u0003\\u0002\\u0001\",\n\
> 300  \"مرحبا هناك\": true,\n\
> 301  \"բարեւ չկա\": -123,\n\
> 302  \"你好\": 1.234,\n\
> 303  \"γεια εκεί\": \"سلام\",\n\
> 304  \"halló þarna\": \"0x1234\",\n\
> 305  \"こんにちは\": {\n\
> 306   \"привет\": [\n\
> 307   ]\n\
> 308  }\n\
> 309 }\n\
> 310 ";

It seems that this depends on system locale or something.

my environment is VS 2010 (en-US) on Win8.1-JA.

my buildconfing:

> . $topsrcdir/browser/config/mozconfig
> 
> # dist dir
> mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../fx-dbg
> 
> mk_add_options MOZ_MAKE_FLAGS="-sj16"
> 
> mk_add_options AUTOCLOBBER=1
> 
> ac_add_options --enable-debug
> ac_add_options --enable-tests
> ac_add_options --enable-logging
> #ac_add_options --enable-metro
> ac_add_options --enable-crashreporter
> 
> ac_add_options --disable-installer
> ac_add_options --disable-updater
MSVS cannot handle UTF-8 string if no BOM.  It depends on OS locale.
Posted patch PatchSplinter Review
https://tbpl.mozilla.org/?tree=Try&usebuildbot=1&rev=d4bd5883d04e
Assignee: nobody → masayuki
Status: NEW → ASSIGNED
Attachment #8492061 - Flags: review?(n.nethercote)
Comment on attachment 8492061 [details] [diff] [review]
Patch

Review of attachment 8492061 [details] [diff] [review]:
-----------------------------------------------------------------

Well, that takes all the fun out of it :(

But being able to compile is useful. Can you add a comment just above |expected| that says "This test uses hexadecimal character escapes because UTF8 literals cause problems for some compilers (see bug 1069726)."

Thanks for fixing this.
Attachment #8492061 - Flags: review?(n.nethercote) → review+
https://hg.mozilla.org/mozilla-central/rev/c5be430095ae
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Target Milestone: --- → mozilla35
Flags: qe-verify-
You need to log in before you can comment on or make changes to this bug.