Ignore:
Timestamp:
Apr 8, 2009, 12:06:14 AM (16 years ago)
Author:
[email protected]
Message:

Reviewed by Darin Adler.

https://bugs.webkit.org/show_bug.cgi?id=25073
JavaScriptCore tests don't run if time zone is not PST

  • API/tests/testapi.c: (timeZoneIsPST): Added a function that checks whether the time zone is PST, using the same method as functions in DateMath.cpp do for formatting the result. (main): Skip date string format test if the time zone is not PST.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/API/tests/testapi.c

    r41931 r42315  
    119119}
    120120
     121static bool timeZoneIsPST()
     122{
     123    char timeZoneName[70];
     124    struct tm gtm;
     125    memset(&gtm, 0, sizeof(gtm));
     126    strftime(timeZoneName, sizeof(timeZoneName), "%Z", &gtm);
     127
     128    return 0 == strcmp("PST", timeZoneName);
     129}
     130
    121131static JSValueRef jsGlobalValue; // non-stack value for testing JSValueProtect()
    122132
     
    10591069    JSValueRef argumentsDateValues[] = { JSValueMakeNumber(context, 0) };
    10601070    o = JSObjectMakeDate(context, 1, argumentsDateValues, NULL);
    1061     assertEqualsAsUTF8String(o, "Wed Dec 31 1969 16:00:00 GMT-0800 (PST)");
     1071    if (timeZoneIsPST())
     1072        assertEqualsAsUTF8String(o, "Wed Dec 31 1969 16:00:00 GMT-0800 (PST)");
    10621073
    10631074    string = JSStringCreateWithUTF8CString("an error message");
Note: See TracChangeset for help on using the changeset viewer.