RESOLVED FIXED 111346
[GTK] Some WebKit2 GTK+ unit tests are failing in 32 bits bot
https://bugs.webkit.org/show_bug.cgi?id=111346
Summary [GTK] Some WebKit2 GTK+ unit tests are failing in 32 bits bot
Carlos Garcia Campos
Reported 2013-03-04 10:37:29 PST
The problem is the use of a temporary CString object in the macro g_assert_cmpstr. It's a common mistake because we usually forget that g_assert_cmpstr is not a function but a macro, that expands to multiple lines. Some examples: ERROR:../../Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitSettings.cpp:277:void assertThatUserAgentIsSentInHeaders(WebViewTest*, const WTF::CString&): assertion failed (convertWebViewMainResourceDataToCString(test).data() == userAgent.data()): ("\021r\241\006lla/5.0 (X11; Linux i686) AppleWebKit/537.30 (KHTML, like Gecko) Chromium/25.0.1349.2 Chrome/25.0.1349.2 Safari/537.30" == "Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.30 (KHTML, like Gecko) Chromium/25.0.1349.2 Chrome/25.0.1349.2 Safari/537.30") ERROR:../../Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitFaviconDatabase.cpp:207:void testGetFaviconURI(FaviconDatabaseTest*, gconstpointer): assertion failed (iconURI.get() == kServer->getURIForPath("/icon/favicon.ico").data()): (NULL == "q\354\317\006://127.0.0.1:55917/icon/favicon.ico") And there are more cases, sometimes the memory is not overwritten yet when the comparison happens, and the test passes.
Attachments
Patch (8.59 KB, patch)
2013-03-04 10:42 PST, Carlos Garcia Campos
no flags
Carlos Garcia Campos
Comment 1 2013-03-04 10:42:10 PST
WebKit Review Bot
Comment 2 2013-03-04 10:44:06 PST
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
WebKit Review Bot
Comment 3 2013-03-04 10:44:20 PST
Attachment 191269 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebKit2/ChangeLog', u'Source/WebKit2/UIProcess/API/gtk/tests/TestDownloads.cpp', u'Source/WebKit2/UIProcess/API/gtk/tests/TestInspectorServer.cpp', u'Source/WebKit2/UIProcess/API/gtk/tests/TestLoaderClient.cpp', u'Source/WebKit2/UIProcess/API/gtk/tests/TestMain.h', u'Source/WebKit2/UIProcess/API/gtk/tests/TestResources.cpp', u'Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitFaviconDatabase.cpp', u'Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitSettings.cpp']" exit_code: 1 Source/WebKit2/UIProcess/API/gtk/tests/TestMain.h:44: More than one command on the same line [whitespace/newline] [4] Source/WebKit2/UIProcess/API/gtk/tests/TestMain.h:45: Else clause should never be on same line as else (use 2 lines) [whitespace/newline] [4] Source/WebKit2/UIProcess/API/gtk/tests/TestMain.h:45: More than one command on the same line in if [whitespace/parens] [4] Source/WebKit2/UIProcess/API/gtk/tests/TestMain.h:47: preprocessor directives (e.g., #ifdef, #define, #import) should never be indented. [whitespace/indent] [4] Total errors found: 4 in 8 files If any of these errors are false positives, please file a bug against check-webkit-style.
Martin Robinson
Comment 4 2013-03-04 10:58:19 PST
Comment on attachment 191269 [details] Patch Looks good for now. Later we probably want to replace all g_assert_cmpstr with a templatized function we can use everywhere.
WebKit Review Bot
Comment 5 2013-03-04 11:34:07 PST
Comment on attachment 191269 [details] Patch Clearing flags on attachment: 191269 Committed r144652: <http://trac.webkit.org/changeset/144652>
WebKit Review Bot
Comment 6 2013-03-04 11:34:10 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.