mgorny created this revision.
mgorny added reviewers: krytarowski, vitalybuka.
Herald added subscribers: Sanitizers, llvm-commits, dberris, kubamracek.
Add two new test cases that test the following stdio.h functions:
- clearerr()
- feof()
- ferror()
- fileno()
- fgetc()
- getc()
- ungetc()
Rep
krytarowski added inline comments.
Comment at: test/sanitizer_common/TestCases/Posix/feof_fileno_ferror.cc:7
+int main(int argc, char **argv) {
+ FILE *fp;
+ int fd;
Please move local variable declaration to the first line used (whenever
possible)
==
vitalybuka added inline comments.
Comment at: test/sanitizer_common/TestCases/Posix/feof_fileno_ferror.cc:49
+
+ fclose(fp);
+ return 0;
why does this close file only on success?
I assume normal test behavior is return 0;
So please replace all return N with as
mgorny marked 4 inline comments as done.
mgorny added inline comments.
Comment at: test/sanitizer_common/TestCases/Posix/feof_fileno_ferror.cc:49
+
+ fclose(fp);
+ return 0;
vitalybuka wrote:
> why does this close file only on success?
> I assume normal test be
mgorny updated this revision to Diff 179679.
mgorny marked an inline comment as done.
mgorny added a comment.
Moved variable definitions, and added asserts.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D56136/new/
https://reviews.llvm.org/D56136
Files:
test/sanitizer_common/TestCases
krytarowski accepted this revision.
krytarowski added inline comments.
This revision is now accepted and ready to land.
Comment at: test/sanitizer_common/TestCases/Posix/feof_fileno_ferror.cc:38
+
+ fclose(fp);
+ return 0;
`assert(!fclose(fp));`
=
krytarowski added inline comments.
Comment at: test/sanitizer_common/TestCases/Posix/feof_fileno_ferror.cc:38
+
+ fclose(fp);
+ return 0;
krytarowski wrote:
> `assert(!fclose(fp));`
alternatively `!= EOF`
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D
mgorny added inline comments.
Comment at: test/sanitizer_common/TestCases/Posix/feof_fileno_ferror.cc:38
+
+ fclose(fp);
+ return 0;
krytarowski wrote:
> krytarowski wrote:
> > `assert(!fclose(fp));`
> alternatively `!= EOF`
It will fail most likely, due to us
mgorny added a comment.
(Do you have another idea how to reliably trigger `ferror`?)
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D56136/new/
https://reviews.llvm.org/D56136
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lis
krytarowski added inline comments.
Comment at: test/sanitizer_common/TestCases/Posix/feof_fileno_ferror.cc:38
+
+ fclose(fp);
+ return 0;
mgorny wrote:
> krytarowski wrote:
> > krytarowski wrote:
> > > `assert(!fclose(fp));`
> > alternatively `!= EOF`
> It will
mgorny updated this revision to Diff 179691.
mgorny added a comment.
Added asserts for `fclose()`.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D56136/new/
https://reviews.llvm.org/D56136
Files:
test/sanitizer_common/TestCases/Posix/feof_fileno_ferror.cc
test/sanitizer_common/TestC
This revision was automatically updated to reflect the committed changes.
Closed by commit rL350225: [sanitizer_common] Add tests for more stdio.h
functions (authored by mgorny, committed by ).
Herald added a subscriber: delcypher.
Changed prior to commit:
https://reviews.llvm.org/D56136?vs=179
12 matches
Mail list logo