syslog-ng source
test-source.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2010-2014 Balabit
3  * Copyright (c) 2010-2014 Viktor Juhasz <viktor.juhasz@balabit.com>
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License version 2 as published
7  * by the Free Software Foundation, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17  *
18  * As an additional exemption you are allowed to compile & link against the
19  * OpenSSL libraries as published by the OpenSSL project. See the file
20  * COPYING for details.
21  *
22  */
23 
24 #ifndef TEST_SOURCE_H_
25 #define TEST_SOURCE_H_
26 
27 #include "syslog-ng.h"
28 #include "journal-reader.h"
29 #include "journald-mock.h"
30 #include <iv.h>
31 
32 typedef struct _TestSource TestSource;
33 typedef struct _TestCase TestCase;
34 
35 struct _TestCase
36 {
37  void (*init)(TestCase *self, TestSource *src, JournalReader *reader, JournalReaderOptions *options);
38  void (*checker)(TestCase *self, TestSource *src, LogMessage *msg);
39  void (*finish)(TestCase *self);
40  gpointer user_data;
41 };
42 
43 
44 TestSource *test_source_new(GlobalConfig *cfg);
45 
46 void test_source_add_test_case(TestSource *s, TestCase *tc);
49 
50 void *journal_reader_test_prepare_with_namespace(const gchar *namespace, GlobalConfig *cfg);
51 gboolean journal_reader_test_allocate_namespace(void *test);
52 void journal_reader_test_destroy(void *test);
53 
54 #endif /* TEST_SOURCE_H_ */
Definition: journal-reader.h:35
Definition: test_logsource.c:61
Definition: test-source.h:36
void(* checker)(TestCase *self, TestSource *src, LogMessage *msg)
Definition: test-source.h:38
void(* init)(TestCase *self, TestSource *src, JournalReader *reader, JournalReaderOptions *options)
Definition: test-source.h:37
void(* finish)(TestCase *self)
Definition: test-source.h:39
gpointer user_data
Definition: test-source.h:40
Definition: test-source.c:30
void journal_reader_test_destroy(void *test)
Definition: test-source.c:185
TestSource * test_source_new(GlobalConfig *cfg)
Definition: test-source.c:110
void test_source_add_test_case(TestSource *s, TestCase *tc)
Definition: test-source.c:130
void test_source_finish_tc(TestSource *s)
Definition: test-source.c:150
void * journal_reader_test_prepare_with_namespace(const gchar *namespace, GlobalConfig *cfg)
Definition: test-source.c:160
void test_source_run_tests(TestSource *s)
Definition: test-source.c:136
gboolean journal_reader_test_allocate_namespace(void *test)
Definition: test-source.c:178
GlobalConfig * cfg
Definition: test_batched_ack_tracker.c:34
CSVScannerOptions options
Definition: test_csv_scanner.c:30
LogMessage * msg
Definition: test_rename.c:35
WildcardFileReader * reader
Definition: test_wildcard_file_reader.c:61