Home | History | Annotate | Download | only in test

Lines Matching refs:config

5 #include "osi/include/config.h"
60 config_t* config = config_new_empty();
61 EXPECT_TRUE(config != NULL);
62 config_free(config);
66 config_t* config = config_new("/meow");
67 EXPECT_TRUE(config == NULL);
68 config_free(config);
72 config_t* config = config_new(CONFIG_FILE);
73 EXPECT_TRUE(config != NULL);
74 config_free(config);
80 config_t* config = config_new(CONFIG_FILE);
81 config_t* clone = config_new_clone(config);
86 config_get_string(config, CONFIG_DEFAULT_SECTION, "first_key", "one"),
89 config_free(config);
94 config_t* config = config_new(CONFIG_FILE);
95 EXPECT_TRUE(config_has_section(config, "DID"));
96 config_free(config);
100 config_t* config = config_new(CONFIG_FILE);
101 EXPECT_TRUE(config_has_key(config, CONFIG_DEFAULT_SECTION, "first_key"));
103 config_get_string(config, CONFIG_DEFAULT_SECTION, "first_key", "meow"),
105 config_free(config);
109 config_t* config = config_new(CONFIG_FILE);
110 EXPECT_TRUE(config_has_key(config, "DID", "recordNumber"));
111 EXPECT_TRUE(config_has_key(config, "DID", "primaryRecord"));
112 EXPECT_TRUE(config_has_key(config, "DID", "productId"));
113 EXPECT_TRUE(config_has_key(config, "DID", "version"));
114 config_free(config);
118 config_t* config = config_new(CONFIG_FILE);
119 EXPECT_FALSE(config_has_key(config, "DID_BAD", "primaryRecord"));
120 EXPECT_FALSE(config_has_key(config, "DID", "primaryRecord_BAD"));
121 EXPECT_FALSE(config_has_key(config, CONFIG_DEFAULT_SECTION, "primaryRecord"));
122 config_free(config);
126 config_t* config = config_new(CONFIG_FILE);
127 EXPECT_EQ(config_get_int(config, "DID", "version", 0), 0x1436);
128 config_free(config);
132 config_t* config = config_new(CONFIG_FILE);
133 EXPECT_EQ(config_get_int(config, "DID", "primaryRecord", 123), 123);
134 config_free(config);
138 config_t* config = config_new(CONFIG_FILE);
139 EXPECT_TRUE(config_remove_section(config, "DID"));
140 EXPECT_FALSE(config_has_section(config, "DID"));
141 EXPECT_FALSE(config_has_key(config, "DID", "productId"));
142 config_free(config);
146 config_t* config = config_new(CONFIG_FILE);
147 EXPECT_FALSE(config_remove_section(config, "not a section"));
148 config_free(config);
152 config_t* config = config_new(CONFIG_FILE);
153 EXPECT_EQ(config_get_int(config, "DID", "productId", 999), 0x1200);
154 EXPECT_TRUE(config_remove_key(config, "DID", "productId"));
155 EXPECT_FALSE(config_has_key(config, "DID", "productId"));
156 config_free(config);
160 config_t* config = config_new(CONFIG_FILE);
161 EXPECT_EQ(config_get_int(config, "DID", "productId", 999), 0x1200);
162 EXPECT_TRUE(config_remove_key(config, "DID", "productId"));
163 EXPECT_EQ(config_get_int(config, "DID", "productId", 999), 999);
164 config_free(config);
168 config_t* config = config_new(CONFIG_FILE);
169 const config_section_node_t* section = config_section_begin(config);
174 config_free(config);
178 config_t* config = config_new(CONFIG_FILE);
179 const config_section_node_t* section = config_section_begin(config);
186 config_free(config);
190 config_t* config = config_new(CONFIG_FILE);
191 const config_section_node_t* section = config_section_begin(config);
194 EXPECT_EQ(section, config_section_end(config));
195 config_free(config);
199 config_t* config = config_new(CONFIG_FILE);
200 EXPECT_TRUE(config_save(config, CONFIG_FILE));
201 config_free(config);