mirror of
https://github.com/pevans/erc-c.git
synced 2025-01-02 09:29:58 +00:00
Add missing tests
This commit is contained in:
parent
888eb25797
commit
55cb80162c
22
tests/log.c
22
tests/log.c
@ -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];
|
||||
|
Loading…
Reference in New Issue
Block a user