summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorunknown <msvensson@neptunus.(none)>2006-08-07 17:26:02 +0200
committerunknown <msvensson@neptunus.(none)>2006-08-07 17:26:02 +0200
commitd09ba5a874909b997caa43725b6990b0a46aaeec (patch)
tree0c0d889e209f1ad40a1f776940daa5c001327689 /tests
parent703c50e639889be2bfd8881cc543f339c81099dd (diff)
downloadmariadb-git-d09ba5a874909b997caa43725b6990b0a46aaeec.tar.gz
Add some more code to analyze why the fgets fails.
Diffstat (limited to 'tests')
-rw-r--r--tests/mysql_client_test.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c
index f5acf179319..32a8e94aee9 100644
--- a/tests/mysql_client_test.c
+++ b/tests/mysql_client_test.c
@@ -14951,9 +14951,18 @@ static void test_bug17667()
do {
memset(line_buffer, '/', MAX_TEST_QUERY_LENGTH*2);
- DIE_UNLESS(fgets(line_buffer, MAX_TEST_QUERY_LENGTH*2, log_file) !=
- NULL);
- /* If we reach EOF before finishing the statement list, then we failed. */
+ if(fgets(line_buffer, MAX_TEST_QUERY_LENGTH*2, log_file) == NULL)
+ {
+ /* If fgets returned NULL, it indicates either error or EOF */
+ if (feof(log_file))
+ DIE("Found EOF before all statements where found");
+ else
+ {
+ fprintf(stderr, "Got error %d while reading from file\n",
+ ferror(log_file));
+ DIE("Read error");
+ }
+ }
} while (my_memmem(line_buffer, MAX_TEST_QUERY_LENGTH*2,
statement_cursor->buffer, statement_cursor->length) == NULL);