1
0
mirror of https://github.com/pevans/erc-c.git synced 2024-07-13 23:30:26 +00:00

Add missing tests

This commit is contained in:
Peter Evans 2018-01-07 15:06:07 -06:00
parent 888eb25797
commit 55cb80162c

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];