From 569ca4f3a4fe533f067d0c21c0624269b9c36c31 Mon Sep 17 00:00:00 2001 From: Wenxian Li Date: Tue, 8 Sep 2015 17:23:15 -0400 Subject: tuple generator phase 3.1, support random, support per template client/server generator, Dynamic sellection of client type Signed-off-by: Wenxian Li --- src/bp_gtest.cpp | 42 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) (limited to 'src/bp_gtest.cpp') diff --git a/src/bp_gtest.cpp b/src/bp_gtest.cpp index 020276cf..94037759 100755 --- a/src/bp_gtest.cpp +++ b/src/bp_gtest.cpp @@ -223,10 +223,10 @@ public: if ( m_req_ports ){ int i; - fl.m_threads_info[0]->m_smart_gen.FreePort(tuple.getClient(),tuple.getClientPort()); + fl.m_threads_info[0]->m_smart_gen.FreePort(0, tuple.getClientId(),tuple.getClientPort()); for (i=0 ; im_smart_gen.FreePort(tuple.getClient(),ports[i]); + fl.m_threads_info[0]->m_smart_gen.FreePort(0,tuple.getClientId(),ports[i]); } delete []ports; } @@ -527,6 +527,44 @@ TEST_F(basic, sfr4) { EXPECT_EQ_UINT32(1, res?1:0)<< "pass"; } +TEST_F(basic, per_template_gen1) { + + CTestBasic t1; + CParserOption * po =&CGlobalInfo::m_options; + po->preview.setVMode(0); + po->preview.setFileWrite(true); + po->cfg_file ="cap2/per_template_gen1.yaml"; + po->out_file ="exp/sfr_4"; + bool res=t1.init(); + EXPECT_EQ_UINT32(1, res?1:0)<< "pass"; +} +TEST_F(basic, per_template_gen2) { + + CTestBasic t1; + CParserOption * po =&CGlobalInfo::m_options; + po->preview.setVMode(0); + po->preview.setFileWrite(true); + po->cfg_file ="cap2/per_template_gen2.yaml"; + po->out_file ="exp/sfr_4"; + bool res=t1.init(); + EXPECT_EQ_UINT32(1, res?1:0)<< "pass"; +} + + +/* +TEST_F(basic, sfr5) { + + CTestBasic t1; + CParserOption * po =&CGlobalInfo::m_options; + po->preview.setVMode(0); + po->preview.setFileWrite(true); + po->cfg_file ="cap2/sfr5.yaml"; + po->out_file ="exp/sfr_5"; + bool res=t1.init(); + EXPECT_EQ_UINT32(1, res?1:0)<< "pass"; +} +*/ + TEST_F(basic, ipv6_convert) { -- cgit 1.2.3-korg