Add missing tests

This commit is contained in:
Peter Evans 2018-01-07 15:06:07 -06:00
parent 888eb25797
commit 55cb80162c
1 changed files with 22 additions and 0 deletions

View File

@ -5,6 +5,28 @@
#include "log.h"
/* Test(log, stream) */
/*
* This test works for both log_stream() and log_open().
*/
Test(log, open)
{
log_open(stdin);
cr_assert_eq(log_stream(), stdin);
log_open(stdout);
cr_assert_eq(log_stream(), stdout);
}
Test(log, close)
{
FILE *fp;
fp = fopen("/tmp/test.log.txt", "w");
log_open(fp);
cr_assert_eq(log_close(), 0);
}
Test(log, write) {
char message[] = "we write the logs";
char message_buffer[128];