int run(int argc, char **argv) {
TrexStatelessCfg cfg;
- cfg.m_port_count = 1;
+ cfg.m_port_count = 2;
cfg.m_rpc_req_resp_cfg = NULL;
cfg.m_rpc_async_cfg = NULL;
cfg.m_rpc_server_verbose = false;
- cfg.m_platform_api = new SimPlatformApi(1);;
+ cfg.m_platform_api = new SimPlatformApi(1);
cfg.m_publisher = NULL;
set_stateless_obj(new TrexStateless(cfg));
+
assert( CMsgIns::Ins()->Create(4) );
int rc = gtest_main(argc, argv);
m_is_free = true;
/* for handlers random generation */
- srand(time(NULL));
+ m_seed = time(NULL);
}
/**
/* generate 8 bytes of random handler */
for (int i = 0; i < 8; ++i) {
- ss << alphanum[rand() % (sizeof(alphanum) - 1)];
+ ss << alphanum[rand_r(&m_seed) % (sizeof(alphanum) - 1)];
}
return (ss.str());
/* handler genereated internally */
std::string m_handler;
+ /* seed for generating random values */
+ unsigned int m_seed;
/* just references defaults... */
static const std::string g_unowned_name;
static const std::initializer_list<std::string> g_types;
static const std::initializer_list<std::string> g_ops;
- mul_type_e m_type;
- mul_op_e m_op;
- double m_value;
+ mul_type_e m_type;
+ mul_op_e m_op;
+ double m_value;
};
#endif /* __TREX_STATELESS_PORT_H__ */