Browse Source
more tests...and some little structural changes to make then happen correctly with coverage reports. KEEP IN MIND: coverage reports lie to you. (But they are a good hint to see whats not testes enough
release0.1.5
more tests...and some little structural changes to make then happen correctly with coverage reports. KEEP IN MIND: coverage reports lie to you. (But they are a good hint to see whats not testes enough
release0.1.5
23 changed files with 188 additions and 88 deletions
-
2.gitignore
-
10Makefile.am.coverage
-
5include/class/class.h
-
2src/class/Makefile.am
-
0src/class/interface/i_class.c
-
13src/http/Makefile.am
-
0src/http/interface/i_http_intro.c
-
0src/http/parser/p_body.c
-
0src/http/parser/p_header.c
-
0src/http/parser/p_post_vars.c
-
0src/http/parser/p_request_vars.c
-
0src/http/worker/answer.c
-
3src/logger/Makefile.am
-
0src/logger/interface/i_logger.c
-
26tests/Makefile.am
-
32tests/classTest.c
-
BINtests/loggerTest
-
83tests/loggerTest.c
-
35tests/mock/mock_class.c
-
29tests/mock/mock_logger.c
-
20tests/mock/mock_logger.h
-
10tests/runtest.c
-
6tests/runtest.h
@ -1,7 +1,6 @@ |
|||
ACLOCAL_AMFLAGS = -I m4 |
|||
AUTOMAKE_OPTIONS = subdir-objects |
|||
|
|||
noinst_LIBRARIES = liblogger.a |
|||
|
|||
liblogger_a_SOURCES = interface/logger.c logger.c stderr.c syslog.c |
|||
liblogger_a_SOURCES = interface/i_logger.c logger.c stderr.c syslog.c |
|||
liblogger_a_CFLAGS = -Wall -I ../../include/ |
|||
@ -0,0 +1,29 @@ |
|||
#include <stdio.h> |
|||
|
|||
#include "class.h" |
|||
#include "logger.h" |
|||
#include "mock/mock_logger.h" |
|||
|
|||
static |
|||
void |
|||
logMock(void * _this, logger_level level, const char * const msg) |
|||
{ |
|||
MockLogger this = _this; |
|||
|
|||
snprintf(this->message, |
|||
MOCK_MESSAGE_MAX - 1, |
|||
"[%s] %s", |
|||
logger_level_str[level], |
|||
msg); |
|||
} |
|||
|
|||
void |
|||
mockLoggerCleanMsg(MockLogger this) |
|||
{ |
|||
this->message[0] = 0; |
|||
} |
|||
|
|||
INIT_IFACE(Logger, logMock); |
|||
CREATE_CLASS(MockLogger, Logger, IFACE(Logger)); |
|||
|
|||
// vim: set ts=4 sw=4: |
|||
@ -0,0 +1,20 @@ |
|||
#ifndef __MOCK_MOCK_LOGGER_H__ |
|||
#define __MOCK_MOCK_LOGGER_H__ |
|||
|
|||
#define MOCK_MESSAGE_MAX 1024 |
|||
|
|||
#include "class.h" |
|||
#include "logger.h" |
|||
|
|||
CLASS(MockLogger) |
|||
{ |
|||
EXTENDS(Logger); |
|||
|
|||
char message[MOCK_MESSAGE_MAX]; |
|||
}; |
|||
|
|||
void mockLoggerCleanMsg(MockLogger); |
|||
|
|||
#endif // __MOCK_MOCK_LOGGER_H__ |
|||
|
|||
// vim: set ts=4 sw=4: |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue