mirror of
https://github.com/emqx/neuron.git
synced 2026-10-25 19:31:41 +08:00
add dynamic library search path configuration, install to /etc/ld.so.conf.d/ dynamic library search path priority: 1. driver.path in neuron.yaml 2. os path
33 lines
923 B
C++
33 lines
923 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);
|
|
|
|
result = neu_config_get_value(2, (char *) "api", (char *) "public_key");
|
|
EXPECT_STREQ("./public_test.pem", result);
|
|
free(result);
|
|
|
|
result = neu_config_get_value(2, (char *) "api", (char *) "private_key");
|
|
EXPECT_STREQ("./private_test.key", result);
|
|
free(result);
|
|
}
|