diff options
author | Hanoh Haim <hhaim@cisco.com> | 2016-09-12 17:55:48 +0300 |
---|---|---|
committer | Hanoh Haim <hhaim@cisco.com> | 2016-09-13 19:37:29 +0300 |
commit | 70dec0ed4d3712f24ac21e05d2c04617751dc8ac (patch) | |
tree | 714c22938e0b053661c342b61029828bd0872f75 /src/gtest | |
parent | c754842a0ec39e704bb92ffc21bb4624db576496 (diff) |
add rand_limit tests
Diffstat (limited to 'src/gtest')
-rw-r--r-- | src/gtest/trex_stateless_gtest.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/gtest/trex_stateless_gtest.cpp b/src/gtest/trex_stateless_gtest.cpp index 10bd0aac..7954e8e6 100644 --- a/src/gtest/trex_stateless_gtest.cpp +++ b/src/gtest/trex_stateless_gtest.cpp @@ -188,6 +188,28 @@ TEST_F(basic_vm, vm_rand_limit0) { vm.Dump(stdout); } +TEST_F(basic_vm, vm_rand_limit1) { + + StreamVm vm; + + vm.add_instruction( new StreamVmInstructionFlowRandLimit( "var1",1,100,0x1234) ); + vm.add_instruction( new StreamVmInstructionWriteToPkt( "var1",26, 0,true) + ); + vm.add_instruction( new StreamVmInstructionFixChecksumIpv4(14) ); + + vm.compile(128); + + + uint32_t program_size=vm.get_dp_instruction_buffer()->get_program_size(); + + printf (" program size : %lu \n",(ulong)program_size); + + + vm.Dump(stdout); + +} + + /* start/stop/stop back to back */ |