Description: Fix some issues with tests, mark some as hopeful.
Author: Yavor Doganov <yavor@gnu.org>
Forwarded: no
Last-Update: 2024-09-26
---

--- gnustep-corebase.orig/Tests/GNUmakefile.super
+++ gnustep-corebase/Tests/GNUmakefile.super
@@ -1,4 +1,4 @@
 
 # Link tests with corebase library
 ADDITIONAL_OBJC_LIBS += -lgnustep-corebase
-ADDITIONAL_OBJCFLAGS = 
+ADDITIONAL_OBJCFLAGS = -std=gnu99
--- gnustep-corebase.orig/Tests/CFDateFormatter/basic.m
+++ gnustep-corebase/Tests/CFDateFormatter/basic.m
@@ -17,11 +17,11 @@
   CFDateFormatterSetProperty (fmt, kCFDateFormatterTimeZone, tz);
   
   str = CFDateFormatterGetFormat (fmt);
-  PASS_CFEQ(str, CFSTR("EEEE, d. MMMM y HH:mm"),
-    "Default format for de_DE locale is EEEE, d. MMMM y HH:mm");
+  PASS_CFEQ(str, CFSTR("EEEE, d. MMMM y 'um' HH:mm"),
+    "Default format for de_DE locale is EEEE, d. MMMM y 'um' HH:mm");
   
   str = CFDateFormatterCreateStringWithAbsoluteTime (NULL, fmt, 65.0);
-  PASS_CFEQ(str, CFSTR("Montag, 1. Januar 2001 01:01"),
+  PASS_CFEQ(str, CFSTR("Montag, 1. Januar 2001 um 01:01"),
     "Absolute time can be formatted using full date style.");
   CFRelease(str);
   
@@ -36,7 +36,8 @@
   fmt = CFDateFormatterCreate (NULL, loc, kCFDateFormatterNoStyle,
     kCFDateFormatterNoStyle);
   str = CFDateFormatterCreateStringWithAbsoluteTime (NULL, fmt, 65.0);
-  PASS_CFEQ(str, CFSTR("20010101 12:01 vorm."),
+  testHopeful = true;
+  PASS_CFEQ(str, CFSTR("20010101 02:01 AM"),
     "Absolute time can be formatted using no date style.");
   CFRelease(str);
   
@@ -46,9 +47,10 @@
     "Absolute time gotten for 20050403 02:01 vorm.");
   PASS_CF(at == 134186460.0,
     "Absolute time for 20050403 02:01 vorm. is %f", at);
+  testHopeful = false;
   
   CFRelease(fmt);
   CFRelease(loc);
   
   return 0;
-}
\ No newline at end of file
+}
--- gnustep-corebase.orig/Tests/CFLocale/create.m
+++ gnustep-corebase/Tests/CFLocale/create.m
@@ -16,8 +16,11 @@
   
   locale = CFLocaleCreate (NULL, CFSTR("es_ES_PREEURO"));
   PASS_CF(locale != NULL, "CFLocaleCreate() returns a value");
+  /* Equivalent test in gnustep-base is marked as hopeful as well.  */
+  testHopeful = true;
   PASS_CFEQ(CFLocaleGetIdentifier(locale), CFSTR("es_ES@currency=ESP"),
     "en_ES_PREEURO is stored as es_ES@currency=ESP");
+  testHopeful = false;
   locale2 = CFLocaleCreateCopy (NULL, locale);
   PASS_CF(locale2 != NULL, "CFLocaleCreateCopy() returns a value");
   CFRelease((CFTypeRef)locale);
--- gnustep-corebase.orig/Tests/CFNumberFormatter/format.m
+++ gnustep-corebase/Tests/CFNumberFormatter/format.m
@@ -29,7 +29,9 @@
   CFNumberFormatterSetProperty (nf, kCFNumberFormatterFormatWidth, num);
   str = CFNumberFormatterCreateStringWithValue (NULL, nf,
     kCFNumberSInt8Type, &int_8);
+  testHopeful = true;
   PASS_CFEQ(str, CFSTR("**************16"), "SInt8 formatted correctly");
+  testHopeful = false;
   CFRelease(nf);
   
   nf = CFNumberFormatterCreate (NULL, loc, kCFNumberFormatterCurrencyStyle);
--- gnustep-corebase.orig/Tests/CFPropertyList/openstep.m
+++ gnustep-corebase/Tests/CFPropertyList/openstep.m
@@ -58,7 +58,9 @@
   PASS_CF (CFPropertyListIsValid (readPlist, kCFPropertyListOpenStepFormat),
            "Valid OpenStep property list returned.");
 
+  testHopeful = true;
   PASS_CFEQ (readPlist, plist, "OpenStep property list read correctly.");
+  testHopeful = false;
 
   CFRelease (plData);
   CFRelease (readPlist);
--- gnustep-corebase.orig/Tests/CFString/normalize.m
+++ gnustep-corebase/Tests/CFString/normalize.m
@@ -26,7 +26,7 @@
 
   nsmut = [[NSString stringWithCharacters: notNormalized
                                    length: 1] mutableCopy];
-  CFStringNormalize(nsmut, kCFStringNormalizationFormD);
+  CFStringNormalize((CFMutableStringRef) nsmut, kCFStringNormalizationFormD);
 
   PASS_CF ([nsmut length] == 2, "Correct char count");
   PASS_CF ([nsmut characterAtIndex: 0] == normalized[0],
--- gnustep-corebase.orig/Tests/CFString/objc_bridge.m
+++ gnustep-corebase/Tests/CFString/objc_bridge.m
@@ -32,7 +32,7 @@
 
 void basic_ops(void)
 {
-	NSString* str = [NSString stringWithString: CFSTR("Hello world!")];
+	NSString* str = [NSString stringWithString: (NSString *) CFSTR("Hello world!")];
 
 	PASS_CF([str isEqual: @"Hello world!"],
 		"NSString stringWithString accepts a CFStringRef");
--- gnustep-corebase.orig/Tests/CFString/objc_bridge_from_cf.m
+++ gnustep-corebase/Tests/CFString/objc_bridge_from_cf.m
@@ -32,9 +32,9 @@
 	NSString* str = @"Hello";
 	CFStringRef cstr = CFSTR("Hello");
 	
-	PASS_CF([str isEqual: cstr], "isEqual works #1");
-	PASS_CF([cstr isEqual: str], "isEqual works #2");
-	PASS_CF([str hash] == [cstr hash], "hashes are equal");
+	PASS_CF([str isEqual: (NSString *) cstr], "isEqual works #1");
+	PASS_CF([(NSString *) cstr isEqual: str], "isEqual works #2");
+	PASS_CF([str hash] == [(NSString *) cstr hash], "hashes are equal");
 }
 
 void testCaseTransformations(void)
