X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=test%2Funit_test_xapp.cc;fp=test%2Funit_test_xapp.cc;h=4e4b670b809fff01093719e8f3e42fe59fc4f9a7;hb=0a168f272a81ac4c3afe42e014f8032f2a159d97;hp=e1d47f12d4660673e30d063596ddce67d9adabbd;hpb=8a198a45af798bc7c9525a2663d397377d01ab01;p=ric-app%2Fadmin.git diff --git a/test/unit_test_xapp.cc b/test/unit_test_xapp.cc index e1d47f1..4e4b670 100644 --- a/test/unit_test_xapp.cc +++ b/test/unit_test_xapp.cc @@ -1,4 +1,6 @@ /* + // basically just set size to be larger than allowed even if actual + // message is small ================================================================================== Copyright (c) 2018-2019 AT&T Intellectual Property. @@ -61,12 +63,6 @@ void dropped_pkts(rmr_mbuf_t *send_msg){ num_dropped_pkts++; } -bool pong_a1(rmr_mbuf_t *rcv_msg){ - rcv_msg->mtype = A1_POLICY_RESP; - num_ping_pkts++; - return true; -} - bool pong_x(rmr_mbuf_t *rcv_msg){ rcv_msg->mtype = 102; //ping port @@ -268,38 +264,8 @@ TEST_CASE("Test xapp functionality", "[xapp]"){ REQUIRE(num_pong_pkts == NumPkts); - // Re-run experiment but now with A1 message type when - // ping responds - pong_xapp.StartThread(pong_a1); - sleep(1); - - failed_tx = 0; - num_ping_pkts = 0; - num_pong_pkts = 0; - - - for(i = 0; i < NumPkts; i++){ - clock_gettime(CLOCK_REALTIME, &(my_message.ts)); - snprintf(my_message.payload, MESSAGE_SIZE, "hello world %d", i); - bool res = ping_xapp.Send(101, sizeof(Test_message), (void *) (&my_message)); - if (!res){ - failed_tx ++; - } - } - - sleep(1); ping_xapp.Stop(); - pong_xapp.Stop(); - - std::cerr <<"Pong received ping pkts = " << num_ping_pkts << " Ping received a1 packets = " << num_pong_pkts << " failures = " << failed_tx << std::endl; - - REQUIRE(num_ping_pkts >= NumPkts); - REQUIRE(num_pong_pkts >= NumPkts); - REQUIRE(failed_tx == 0); - - - } } @@ -329,10 +295,12 @@ TEST_CASE(" Test out various transmission methods ..", "1"){ sleep(1); // Test sending a message of size larger than allowed + // basically just set size to be larger than allowed even if actual + // message is small res = test_xapp.Send(102, RMR_BUFFER_SIZE + 100, (void *)(&my_message)); REQUIRE(res == false); - res = test_xapp.Send(102, RMR_BUFFER_SIZE + 100, (void *)(&my_message), "id"); + res = test_xapp.Send(102, RMR_BUFFER_SIZE + 100, (void *)(&my_message), my_meid); REQUIRE(res == false); test_xapp.Stop();