Commit Graph

2 Commits

Author SHA1 Message Date
Philip Withnall
4481a217c4 gdump: Handle feof() and ferror() separately
The return value from `fread()` doesn’t actually indicate whether the
read failed due to EOF or due to a read error.

Rework the code so that errors are reported correctly, EOF is handled
silently, and as a byproduct, blank lines in the input file are ignored
and skipped over.

Spotted by scan-build.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2025-10-27 21:34:08 +00:00
Philip Withnall
5b26ef2e46 tests: Add basic tests for gdump.c in libgirepository
It’s currently completely untested. Let’s add a few basic tests so that
adding more tests in future is easier.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-06-04 15:52:05 +01:00