diff options
author | Jere Leppänen <jere.leppanen@nokia.com> | 2024-02-26 11:41:41 +0200 |
---|---|---|
committer | Matias Elo <matias.elo@nokia.com> | 2024-02-29 09:33:12 +0200 |
commit | 9f8ddd038ed2fb199ceb36f094cbdb8fb84ddb07 (patch) | |
tree | 2a467981b86612a651bb71bd30d487cb43c3f374 /test/validation/api/traffic_mngr | |
parent | d08fc175678dcef44b006c2ca897c4f9720596cb (diff) |
validation: use fewer CU_ASSERT types
Use only CU_ASSERT and CU_ASSERT_FATAL CUnit assert types. This makes
the test code more readable, and there's no benefit in using the other
assert types.
Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Janne Peltonen <janne.peltonen@nokia.com>
Diffstat (limited to 'test/validation/api/traffic_mngr')
-rw-r--r-- | test/validation/api/traffic_mngr/traffic_mngr.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/test/validation/api/traffic_mngr/traffic_mngr.c b/test/validation/api/traffic_mngr/traffic_mngr.c index b7f546dcd..041e32ab5 100644 --- a/test/validation/api/traffic_mngr/traffic_mngr.c +++ b/test/validation/api/traffic_mngr/traffic_mngr.c @@ -4456,7 +4456,7 @@ static void test_defaults(uint8_t fill) memset(&req, fill, sizeof(req)); odp_tm_requirements_init(&req); - CU_ASSERT_EQUAL(req.num_levels, 0); + CU_ASSERT(req.num_levels == 0); CU_ASSERT(!req.tm_queue_shaper_needed); CU_ASSERT(!req.tm_queue_wred_needed); CU_ASSERT(!req.tm_queue_dual_slope_needed); @@ -4466,7 +4466,7 @@ static void test_defaults(uint8_t fill) CU_ASSERT(!req.drop_prec_marking_needed); for (n = 0; n < ODP_NUM_PACKET_COLORS; n++) CU_ASSERT(!req.marking_colors_needed[n]); - CU_ASSERT_EQUAL(req.pkt_prio_mode, ODP_TM_PKT_PRIO_MODE_PRESERVE); + CU_ASSERT(req.pkt_prio_mode == ODP_TM_PKT_PRIO_MODE_PRESERVE); for (n = 0; n < ODP_TM_MAX_LEVELS; n++) { odp_tm_level_requirements_t *l_req = &req.per_level[n]; @@ -4481,14 +4481,14 @@ static void test_defaults(uint8_t fill) memset(&shaper, fill, sizeof(shaper)); odp_tm_shaper_params_init(&shaper); CU_ASSERT(shaper.packet_mode == ODP_TM_SHAPER_RATE_SHAPE); - CU_ASSERT_EQUAL(shaper.shaper_len_adjust, 0); + CU_ASSERT(shaper.shaper_len_adjust == 0); CU_ASSERT(!shaper.dual_rate); CU_ASSERT(!shaper.packet_mode); memset(&sched, 0xff, sizeof(sched)); odp_tm_sched_params_init(&sched); for (n = 0; n < ODP_TM_MAX_PRIORITIES; n++) - CU_ASSERT_EQUAL(sched.sched_modes[n], ODP_TM_BYTE_BASED_WEIGHTS); + CU_ASSERT(sched.sched_modes[n] == ODP_TM_BYTE_BASED_WEIGHTS); memset(&threshold, fill, sizeof(threshold)); odp_tm_threshold_params_init(&threshold); @@ -4502,18 +4502,18 @@ static void test_defaults(uint8_t fill) memset(&node, fill, sizeof(node)); odp_tm_node_params_init(&node); - CU_ASSERT_EQUAL(node.shaper_profile, ODP_TM_INVALID); - CU_ASSERT_EQUAL(node.threshold_profile, ODP_TM_INVALID); + CU_ASSERT(node.shaper_profile == ODP_TM_INVALID); + CU_ASSERT(node.threshold_profile == ODP_TM_INVALID); for (n = 0; n < ODP_NUM_PACKET_COLORS; n++) - CU_ASSERT_EQUAL(node.wred_profile[n], ODP_TM_INVALID); + CU_ASSERT(node.wred_profile[n] == ODP_TM_INVALID); memset(&queue, fill, sizeof(queue)); odp_tm_queue_params_init(&queue); - CU_ASSERT_EQUAL(queue.shaper_profile, ODP_TM_INVALID); - CU_ASSERT_EQUAL(queue.threshold_profile, ODP_TM_INVALID); + CU_ASSERT(queue.shaper_profile == ODP_TM_INVALID); + CU_ASSERT(queue.threshold_profile == ODP_TM_INVALID); for (n = 0; n < ODP_NUM_PACKET_COLORS; n++) - CU_ASSERT_EQUAL(queue.wred_profile[n], ODP_TM_INVALID); - CU_ASSERT_EQUAL(queue.priority, 0); + CU_ASSERT(queue.wred_profile[n] == ODP_TM_INVALID); + CU_ASSERT(queue.priority == 0); CU_ASSERT(queue.ordered_enqueue); } |