本文整理汇总了C++中CTupleBase类的典型用法代码示例。如果您正苦于以下问题:C++ CTupleBase类的具体用法?C++ CTupleBase怎么用?C++ CTupleBase使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CTupleBase类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TEST
TEST(tuple_gen,servePoolSim) {
CServerPoolSimple gen;
gen.Create(cdSEQ_DIST,
0x30000001, 0x40000001, 64000,10);
CTupleBase result;
uint32_t result_dest;
for(int i=0;i<10;i++) {
gen.GenerateTuple(result);
printf(" S:%x \n",result.getServer());
result_dest = result.getServer();
EXPECT_EQ(result_dest, (uint32_t) (((0x30000001+i)) ) );
}
gen.Delete();
gen.Create(cdSEQ_DIST,
0x30000001, 0x30000003, 64000,1000);
for(int i=0;i<10;i++) {
gen.GenerateTuple(result);
printf(" S:%x \n",result.getServer());
result_dest = result.getServer();
EXPECT_EQ(result_dest, (uint32_t) (((0x30000001+i%3)) ) );
}
gen.Delete();
// EXPECT_EQ((size_t)0, gen.m_clients.size());
}
示例2: TEST
/* UIT of CClientPool, using CClientInfo */
TEST(tuple_gen,clientPool) {
CClientPool gen;
gen.Create(cdSEQ_DIST,
0x10000001, 0x10000021, 64000,1000, g_dummy,
0,0);
CTupleBase result;
uint32_t result_src;
uint16_t result_port;
for(int i=0;i<10;i++) {
gen.GenerateTuple(result);
printf(" C:%x P:%d \n",result.getClient(),result.getClientPort());
result_src = result.getClient();
result_port = result.getClientPort();
EXPECT_EQ(result_src, (uint32_t)(0x10000001+i));
EXPECT_EQ(result_port, 1024);
}
gen.Delete();
// EXPECT_EQ((size_t)0, gen.m_clients.size());
}