tests: use the test helpers in more places

This is mostly cosmetic. It makes those test binaries support SYSTEMD_LOG_*
environment variables.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2019-03-04 14:15:38 +01:00
parent 46d4d67d79
commit f68a26221c
9 changed files with 37 additions and 23 deletions
+2 -3
View File
@@ -10,6 +10,7 @@
#include "log.h"
#include "resolved-etc-hosts.h"
#include "strv.h"
#include "tests.h"
#include "tmpfile-util.h"
static void test_parse_etc_hosts_system(void) {
@@ -137,9 +138,7 @@ static void test_parse_file(const char *fname) {
}
int main(int argc, char **argv) {
log_set_max_level(LOG_DEBUG);
log_parse_environment();
log_open();
test_setup_logging(LOG_DEBUG);
if (argc == 1) {
test_parse_etc_hosts_system();
+2 -4
View File
@@ -2,6 +2,7 @@
#include "log.h"
#include "resolved-dns-packet.h"
#include "tests.h"
static void test_dns_packet_new(void) {
size_t i;
@@ -23,10 +24,7 @@ static void test_dns_packet_new(void) {
}
int main(int argc, char **argv) {
log_set_max_level(LOG_DEBUG);
log_parse_environment();
log_open();
test_setup_logging(LOG_DEBUG);
test_dns_packet_new();