OLD | NEW |
1 /* | 1 /* |
2 ********************************************************************** | 2 ********************************************************************** |
3 * Copyright (C) 2004-2013, International Business Machines | 3 * Copyright (C) 2004-2014, International Business Machines |
4 * Corporation and others. All Rights Reserved. | 4 * Corporation and others. All Rights Reserved. |
5 ********************************************************************** | 5 ********************************************************************** |
6 * file name: filetst.c | 6 * file name: filetst.c |
7 * encoding: US-ASCII | 7 * encoding: US-ASCII |
8 * tab size: 8 (not used) | 8 * tab size: 8 (not used) |
9 * indentation:4 | 9 * indentation:4 |
10 * | 10 * |
11 * created on: 2004apr06 | 11 * created on: 2004apr06 |
12 * created by: George Rhoten | 12 * created by: George Rhoten |
13 */ | 13 */ |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 *newDoubleValuePtr = -1.0; | 232 *newDoubleValuePtr = -1.0; |
233 u_fscanf(myFile, "Spell Out %%V (non-ANSI): %V\n", newDoubleValuePtr); | 233 u_fscanf(myFile, "Spell Out %%V (non-ANSI): %V\n", newDoubleValuePtr); |
234 if (myFloat != *newDoubleValuePtr) { | 234 if (myFloat != *newDoubleValuePtr) { |
235 log_err("%%V Got: %f, Expected: %f\n", *newDoubleValuePtr, myFloat); | 235 log_err("%%V Got: %f, Expected: %f\n", *newDoubleValuePtr, myFloat); |
236 } | 236 } |
237 | 237 |
238 u_fgets(myUString, 4, myFile); | 238 u_fgets(myUString, 4, myFile); |
239 myString[2] = '!'; | 239 myString[2] = '!'; |
240 myString[3] = '!'; | 240 myString[3] = '!'; |
241 u_austrncpy(myString, myUString, sizeof(myUString)/sizeof(*myUString)); | 241 u_austrncpy(myString, myUString, sizeof(myUString)/sizeof(*myUString)); |
242 if (myString == NULL || strcmp(myString, "\t\n") != 0) { | 242 if (strcmp(myString, "\t\n") != 0) { |
243 log_err("u_fgets got \"%s\"\n", myString); | 243 log_err("u_fgets got \"%s\"\n", myString); |
244 } | 244 } |
245 | 245 |
246 if (u_fgets(myUString, sizeof(myUString)/sizeof(*myUString), myFile) != myUS
tring) { | 246 if (u_fgets(myUString, sizeof(myUString)/sizeof(*myUString), myFile) != myUS
tring) { |
247 log_err("u_fgets did not return myUString\n"); | 247 log_err("u_fgets did not return myUString\n"); |
248 } | 248 } |
249 u_austrncpy(myString, myUString, sizeof(myUString)/sizeof(*myUString)); | 249 u_austrncpy(myString, myUString, sizeof(myUString)/sizeof(*myUString)); |
250 if (myString == NULL || strcmp(myString, "Pointer to integer (Count) %n: n=1
n=1\n") != 0) { | 250 if (strcmp(myString, "Pointer to integer (Count) %n: n=1 n=1\n") != 0) { |
251 log_err("u_fgets got \"%s\"\n", myString); | 251 log_err("u_fgets got \"%s\"\n", myString); |
252 } | 252 } |
253 | 253 |
254 if (u_fgets(myUString, sizeof(myUString)/sizeof(*myUString), myFile) != myUS
tring) { | 254 if (u_fgets(myUString, sizeof(myUString)/sizeof(*myUString), myFile) != myUS
tring) { |
255 log_err("u_fgets did not return myUString\n"); | 255 log_err("u_fgets did not return myUString\n"); |
256 } | 256 } |
257 u_austrncpy(myString, myUString, sizeof(myUString)/sizeof(*myUString)); | 257 u_austrncpy(myString, myUString, sizeof(myUString)/sizeof(*myUString)); |
258 if (myString == NULL || strcmp(myString, "Pointer to integer Value: 37\n") !
= 0) { | 258 if (strcmp(myString, "Pointer to integer Value: 37\n") != 0) { |
259 log_err("u_fgets got \"%s\"\n", myString); | 259 log_err("u_fgets got \"%s\"\n", myString); |
260 } | 260 } |
261 | 261 |
262 if (u_fgets(myUString, sizeof(myUString)/sizeof(*myUString), myFile) != myUS
tring) { | 262 if (u_fgets(myUString, sizeof(myUString)/sizeof(*myUString), myFile) != myUS
tring) { |
263 log_err("u_fgets did not return myUString\n"); | 263 log_err("u_fgets did not return myUString\n"); |
264 } | 264 } |
265 u_austrncpy(myString, myUString, sizeof(myUString)/sizeof(*myUString)); | 265 u_austrncpy(myString, myUString, sizeof(myUString)/sizeof(*myUString)); |
266 if (myString == NULL || strcmp(myString, "This is a long test123456789012345
678901234567890123456789012345678901234567890\n") != 0) { | 266 if (strcmp(myString, "This is a long test12345678901234567890123456789012345
6789012345678901234567890\n") != 0) { |
267 log_err("u_fgets got \"%s\"\n", myString); | 267 log_err("u_fgets got \"%s\"\n", myString); |
268 } | 268 } |
269 | 269 |
270 if (u_fgets(myUString, 0, myFile) != NULL) { | 270 if (u_fgets(myUString, 0, myFile) != NULL) { |
271 log_err("u_fgets got \"%s\" and it should have returned NULL\n", myStrin
g); | 271 log_err("u_fgets got \"%s\" and it should have returned NULL\n", myStrin
g); |
272 } | 272 } |
273 | 273 |
274 if (u_fgets(myUString, 1, myFile) != myUString) { | 274 if (u_fgets(myUString, 1, myFile) != myUString) { |
275 log_err("u_fgets did not return myUString\n"); | 275 log_err("u_fgets did not return myUString\n"); |
276 } | 276 } |
277 u_austrncpy(myString, myUString, sizeof(myUString)/sizeof(*myUString)); | 277 u_austrncpy(myString, myUString, sizeof(myUString)/sizeof(*myUString)); |
278 if (myString == NULL || strcmp(myString, "") != 0) { | 278 if (strcmp(myString, "") != 0) { |
279 log_err("u_fgets got \"%s\"\n", myString); | 279 log_err("u_fgets got \"%s\"\n", myString); |
280 } | 280 } |
281 | 281 |
282 if (u_fgets(myUString, 2, myFile) != myUString) { | 282 if (u_fgets(myUString, 2, myFile) != myUString) { |
283 log_err("u_fgets did not return myUString\n"); | 283 log_err("u_fgets did not return myUString\n"); |
284 } | 284 } |
285 u_austrncpy(myString, myUString, sizeof(myUString)/sizeof(*myUString)); | 285 u_austrncpy(myString, myUString, sizeof(myUString)/sizeof(*myUString)); |
286 if (myString == NULL || strcmp(myString, "\t") != 0) { | 286 if (strcmp(myString, "\t") != 0) { |
287 log_err("u_fgets got \"%s\"\n", myString); | 287 log_err("u_fgets got \"%s\"\n", myString); |
288 } | 288 } |
289 | 289 |
290 u_austrncpy(myString, u_fgets(myUString, sizeof(myUString)/sizeof(*myUString
), myFile), | 290 u_austrncpy(myString, u_fgets(myUString, sizeof(myUString)/sizeof(*myUString
), myFile), |
291 sizeof(myUString)/sizeof(*myUString)); | 291 sizeof(myUString)/sizeof(*myUString)); |
292 if (strcmp(myString, "Normal fprintf count: n=1 n=1\n") != 0) { | 292 if (strcmp(myString, "Normal fprintf count: n=1 n=1\n") != 0) { |
293 log_err("u_fgets got \"%s\"\n", myString); | 293 log_err("u_fgets got \"%s\"\n", myString); |
294 } | 294 } |
295 | 295 |
296 if (u_feof(myFile)) { | 296 if (u_feof(myFile)) { |
(...skipping 1308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1605 #if !UCONFIG_NO_FORMATTING | 1605 #if !UCONFIG_NO_FORMATTING |
1606 addTest(root, &TestCodepageAndLocale, "file/TestCodepageAndLocale"); | 1606 addTest(root, &TestCodepageAndLocale, "file/TestCodepageAndLocale"); |
1607 addTest(root, &TestFprintfFormat, "file/TestFprintfFormat"); | 1607 addTest(root, &TestFprintfFormat, "file/TestFprintfFormat"); |
1608 addTest(root, &TestFScanset, "file/TestFScanset"); | 1608 addTest(root, &TestFScanset, "file/TestFScanset"); |
1609 addTest(root, &TestFilePrintCompatibility, "file/TestFilePrintCompatibility"
); | 1609 addTest(root, &TestFilePrintCompatibility, "file/TestFilePrintCompatibility"
); |
1610 addTest(root, &TestBadScanfFormat, "file/TestBadScanfFormat"); | 1610 addTest(root, &TestBadScanfFormat, "file/TestBadScanfFormat"); |
1611 addTest(root, &TestVargs, "file/TestVargs"); | 1611 addTest(root, &TestVargs, "file/TestVargs"); |
1612 addTest(root, &TestUnicodeFormat, "file/TestUnicodeFormat"); | 1612 addTest(root, &TestUnicodeFormat, "file/TestUnicodeFormat"); |
1613 #endif | 1613 #endif |
1614 } | 1614 } |
OLD | NEW |