- Timestamp:
- Oct 24, 2014, 8:27:59 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libc/tests/libc/smoketests/setlocale-1.c
r3897 r3915 61 61 { 62 62 char *psz1; 63 char *psz1Copy; 63 64 char *psz2; 64 65 int rc = 0; … … 66 67 setlocale(LC_ALL, "en_US"); 67 68 psz1 = setlocale(LC_CTYPE, "de_DE"); 69 psz1Copy = psz1 ? strdup(psz1) : NULL; 70 68 71 psz2 = setlocale(LC_CTYPE, "de_DE"); 69 if (psz1 && psz2 && !strcmp(psz1, psz2)) 70 printf("2nd setlocale returns the same. %s errno=%d\n", psz1, errno); 72 if (psz1 == psz2 && psz2 && !strcmp(psz1Copy, psz2)) 73 printf("2nd setlocale returns the same pointer, great (%s). errno=%d\n", psz1, errno); 74 else if (psz1 && psz2 && !strcmp(psz1Copy, psz2)) 75 { 76 #if 1 /* kLibC behaviour */ 77 printf("error: 2nd setlocale returns different points, but same value (%s): %p != %p errno=%d\n", 78 psz2, psz1, psz2, errno); 79 rc++; 80 #else 81 printf("2nd setlocale returns the same value. %s errno=%d\n", psz2, errno); 82 #endif 83 } 71 84 else 72 85 { 73 printf("error: 2nd setlocale returns differntly. %s != %s errno=%d\n", psz1, psz2, errno);86 printf("error: 2nd setlocale returns differntly. %s != %s (%p, %p) errno=%d\n", psz1, psz2, psz1, psz2, errno); 74 87 rc++; 75 88 } 89 free(psz1Copy); 76 90 77 91 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.