[Webkit-unassigned] [Bug 84446] [GTK] Build and run TestWebKitAPI WebKit2 unit tests

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Apr 24 23:22:53 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=84446





--- Comment #12 from Carlos Garcia Campos <cgarcia at igalia.com>  2012-04-24 23:22:53 PST ---
(In reply to comment #11)
> (From update of attachment 138595 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=138595&action=review
> 
> > Tools/TestWebKitAPI/gtk/PlatformUtilitiesGtk.cpp:66
> > +static char* getEnvironmentVariableAsUTF8String(const char* variableName)
> > +{
> > +    const char* value = g_getenv(variableName);
> > +    if (!value) {
> > +        g_printerr("%s environment variable not found\n", variableName);
> > +        exit(1);
> > +    }
> > +    gsize bytesWritten;
> > +    return g_filename_to_utf8(value, -1, 0, &bytesWritten, 0);
> > +}
> 
> I guess you didn't want to split this?

No, sorry, I forgot to reply to your comment. In this file this function is only used to get paths from the environment, and the only use of the convertFilenameToString() function would be from getEnvironmentVariable(). I agree with your reasoning, in general, but in this particular case I think we could just rename the function as something like getFilenameFromEnvironmentVariableAsUTF8(). 

Also note that the code expects a char *, so with your approach we would be converting from utf8 to utf16 to return a String and then again to utf8 to create the WKString.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list