parent
f3743a6e01
commit
aaf8bcb688
@ -1,41 +0,0 @@
|
||||
#ifndef WFD_CONFIG_INTERN_H
|
||||
#define WFD_CONFIG_INTERN_H
|
||||
|
||||
#ifdef _cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
extern struct wfd_config *
|
||||
wfd_config_create(void);
|
||||
|
||||
extern void
|
||||
wfd_config_set_server_vhostname(
|
||||
struct wfd_config * config,
|
||||
char const * vhost_name);
|
||||
|
||||
extern void
|
||||
wfd_config_set_server_port(
|
||||
struct wfd_config * config,
|
||||
int port);
|
||||
|
||||
extern void
|
||||
wfd_config_set_server_cert(
|
||||
struct wfd_config * config,
|
||||
char const * cert);
|
||||
|
||||
extern void
|
||||
wfd_config_set_server_key(
|
||||
struct wfd_config * config,
|
||||
char const * key);
|
||||
|
||||
extern void
|
||||
wfd_config_set_server_document_root(
|
||||
struct wfd_config * config,
|
||||
char const * document_root);
|
||||
|
||||
#ifdef _cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
@ -0,0 +1,20 @@
|
||||
#include <gtest/gtest.h>
|
||||
#include "webfused/config/config.h"
|
||||
|
||||
TEST(config, server_config)
|
||||
{
|
||||
wfd_config * config = wfd_config_create();
|
||||
ASSERT_NE(nullptr, config);
|
||||
|
||||
wfd_config_builder builder = wfd_config_get_builder(config);
|
||||
wfd_config_builder_set_server_vhostname(builder, "localhost");
|
||||
wfd_config_builder_set_server_port(builder, 8443);
|
||||
wfd_config_builder_set_server_key(builder, "/path/to/key.pem");
|
||||
wfd_config_builder_set_server_cert(builder, "/path/to/cert.pem");
|
||||
wfd_config_builder_set_server_document_root(builder, "/var/www");
|
||||
|
||||
wf_server_config * server_config = wfd_config_get_server_config(config);
|
||||
ASSERT_NE(nullptr, server_config);
|
||||
|
||||
wfd_config_dispose(config);
|
||||
}
|
Loading…
Reference in new issue