Skip to content

Commit c3425b9

Browse files
Remove redundant tests
1 parent fcb5361 commit c3425b9

File tree

1 file changed

+0
-53
lines changed

1 file changed

+0
-53
lines changed

clang/test/Analysis/stream.c

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -364,19 +364,6 @@ void fflush_on_open_failed_stream(void) {
364364
fclose(F);
365365
}
366366

367-
void test_fscanf_eof() {
368-
FILE *F1 = tmpfile();
369-
if (!F1)
370-
return;
371-
372-
int a;
373-
unsigned b;
374-
int ret = fscanf(F1, "%d %u", &a, &b);
375-
char c = fgetc(F1); // expected-warning {{Read function called when stream is in EOF state. Function has no effect}}
376-
// expected-warning@-1 {{File position of the stream might be 'indeterminate' after a failed operation. Can cause undefined behavior}}
377-
fclose(F1);
378-
}
379-
380367
void test_fscanf_escape() {
381368
FILE *F1 = tmpfile();
382369
if (!F1)
@@ -408,46 +395,6 @@ void test_fscanf_escape() {
408395
fclose(F1);
409396
}
410397

411-
void test_fputc() {
412-
FILE *F1 = tmpfile();
413-
if (!F1)
414-
return;
415-
416-
char a = 'y'; // 'y' = 121 ASCII
417-
char r = fputc(a, F1);
418-
if (r != EOF) {
419-
clang_analyzer_dump_char(r); // expected-warning {{121 S8b}}
420-
char z = fgetc(F1);
421-
} else {
422-
clang_analyzer_dump_char(r); // expected-warning {{-1 S8b}}
423-
}
424-
425-
fclose(F1);
426-
}
427-
428-
void test_fputs() {
429-
FILE *F1 = tmpfile();
430-
if (!F1)
431-
return;
432-
433-
char buffer[] = "HELLO";
434-
int r = fputs(buffer, F1);
435-
if (r >= 0) {
436-
// fputs does not invalidate the input buffer (72 is ascii for 'H')
437-
clang_analyzer_dump_char(buffer[0]); // expected-warning {{72 S8b}}
438-
} else if (r == EOF) {
439-
// fputs does not invalidate the input buffer, *and* this branch
440-
// can happen
441-
clang_analyzer_dump_char(buffer[0]); // expected-warning {{72 S8b}}
442-
} else {
443-
// This branch can not happen
444-
int *p = NULL;
445-
*p = 0;
446-
}
447-
448-
fclose(F1);
449-
}
450-
451398
void test_fprintf() {
452399
FILE *F1 = tmpfile();
453400
if (!F1)

0 commit comments

Comments
 (0)