mirror of
https://github.com/emqx/neuron.git
synced 2026-10-19 05:51:27 +08:00
e83c4253ba
neuron /config/neuron.yaml /config/public.pem /config/private.key /plugins/xxx.so /plugins/schema/xxx.json
25 lines
635 B
C++
25 lines
635 B
C++
#include <gtest/gtest.h>
|
|
|
|
#include "config.h"
|
|
|
|
TEST(ConfigTest, ReadConfig)
|
|
{
|
|
neu_config_init((char *) "./neuron.yaml");
|
|
|
|
char *result = neu_config_get_value(2, (char *) "web", (char *) "host");
|
|
EXPECT_STREQ("0.0.0.0", result);
|
|
free(result);
|
|
|
|
result = neu_config_get_value(2, (char *) "web", (char *) "port");
|
|
EXPECT_STREQ("7000", result);
|
|
free(result);
|
|
|
|
result = neu_config_get_value(2, (char *) "api", (char *) "host");
|
|
EXPECT_STREQ("0.0.0.0", result);
|
|
free(result);
|
|
|
|
result = neu_config_get_value(2, (char *) "api", (char *) "port");
|
|
EXPECT_STREQ("7001", result);
|
|
free(result);
|
|
}
|