MCPcopy Create free account
hub / github.com/Tencent/phxqueue / TestStoreConfig

Method TestStoreConfig

phxqueue/test/test_config.cpp:255–301  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

253}
254
255void TestConfig::TestStoreConfig(const config::StoreConfig *store_config) {
256 const int expected_store_id{1};
257 comm::proto::Addr expected_addr;
258 expected_addr.set_ip("127.0.0.1");
259 expected_addr.set_port(5100);
260 expected_addr.set_paxos_port(5101);
261
262 // GetAllStore
263 {
264 vector<shared_ptr<const config::proto::Store> > stores;
265 const int expected_nr_store{1};
266
267 assert(comm::RetCode::RET_OK == store_config->GetAllStore(stores));
268 assert(expected_nr_store == stores.size());
269 }
270
271 // GetAllStoreID
272 {
273 set<int> store_ids;
274 const int expected_nr_store{1};
275
276 assert(comm::RetCode::RET_OK == store_config->GetAllStoreID(store_ids));
277 assert(expected_nr_store == store_ids.size());
278 }
279
280 // GetStoreByStoreID
281 {
282
283 shared_ptr<const config::proto::Store> store;
284 assert(comm::RetCode::RET_OK == store_config->GetStoreByStoreID(expected_store_id, store));
285 assert(store);
286 }
287
288 // GetStoreIDByAddr
289 {
290 int store_id;
291 assert(comm::RetCode::RET_OK == store_config->GetStoreIDByAddr(expected_addr, store_id));
292 assert(expected_store_id == store_id);
293 }
294
295 // GetStoreByAddr
296 {
297 shared_ptr<const config::proto::Store> store;
298 assert(comm::RetCode::RET_OK == store_config->GetStoreByAddr(expected_addr, store));
299 assert(store);
300 }
301}
302
303
304void TestConfig::TestConsumerConfig(const config::ConsumerConfig *consumer_config) {

Callers

nothing calls this directly

Calls 5

GetAllStoreMethod · 0.80
GetAllStoreIDMethod · 0.80
GetStoreByStoreIDMethod · 0.80
GetStoreIDByAddrMethod · 0.80
GetStoreByAddrMethod · 0.80

Tested by

no test coverage detected