@@ -9,7 +9,7 @@
#include "odp_classification_testsuites.h"
#include "classification.h"
-static CU_SuiteInfo classification_suites[] = {
+CU_SuiteInfo classification_suites[] = {
{ .pName = "classification basic",
.pTests = classification_suite_basic,
},
@@ -4,4 +4,35 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <CUnit/Basic.h>
+
+/* test functions: */
+void classification_test_create_cos(void);
+void classification_test_destroy_cos(void);
+void classification_test_create_pmr_match(void);
+void classification_test_destroy_pmr(void);
+void classification_test_cos_set_queue(void);
+void classification_test_cos_set_drop(void);
+void classification_test_pmr_match_set_create(void);
+void classification_test_pmr_match_set_destroy(void);
+
+void classification_test_pktio_set_skip(void);
+void classification_test_pktio_set_headroom(void);
+void classification_test_pmr_terms_avail(void);
+void classification_test_pmr_terms_cap(void);
+void classification_test_pktio_configure(void);
+void classification_test_pktio_test(void);
+
+/* test arrays: */
+extern CU_TestInfo classification_suite_basic[];
+extern CU_TestInfo classification_suite[];
+
+/* test array init/term functions: */
+int classification_suite_init(void);
+int classification_suite_term(void);
+
+/* test registery: */
+extern CU_SuiteInfo classification_suites[];
+
+/* main test program: */
int classification_main(void);
@@ -5,10 +5,11 @@
*/
#include "odp_classification_testsuites.h"
+#include "classification.h"
#define PMR_SET_NUM 5
-static void classification_test_create_cos(void)
+void classification_test_create_cos(void)
{
odp_cos_t cos;
char name[ODP_COS_NAME_LEN];
@@ -19,7 +20,7 @@ static void classification_test_create_cos(void)
odp_cos_destroy(cos);
}
-static void classification_test_destroy_cos(void)
+void classification_test_destroy_cos(void)
{
odp_cos_t cos;
char name[ODP_COS_NAME_LEN];
@@ -33,7 +34,7 @@ static void classification_test_destroy_cos(void)
CU_ASSERT(retval < 0);
}
-static void classification_test_create_pmr_match(void)
+void classification_test_create_pmr_match(void)
{
odp_pmr_t pmr;
uint16_t val;
@@ -46,7 +47,7 @@ static void classification_test_create_pmr_match(void)
odp_pmr_destroy(pmr);
}
-static void classification_test_destroy_pmr(void)
+void classification_test_destroy_pmr(void)
{
odp_pmr_t pmr;
uint16_t val;
@@ -62,7 +63,7 @@ static void classification_test_destroy_pmr(void)
CU_ASSERT(retval < 0);
}
-static void classification_test_cos_set_queue(void)
+void classification_test_cos_set_queue(void)
{
int retval;
char cosname[ODP_COS_NAME_LEN];
@@ -87,7 +88,7 @@ static void classification_test_cos_set_queue(void)
odp_queue_destroy(queue_cos);
}
-static void classification_test_cos_set_drop(void)
+void classification_test_cos_set_drop(void)
{
int retval;
char cosname[ODP_COS_NAME_LEN];
@@ -103,7 +104,7 @@ static void classification_test_cos_set_drop(void)
odp_cos_destroy(cos_drop);
}
-static void classification_test_pmr_match_set_create(void)
+void classification_test_pmr_match_set_create(void)
{
odp_pmr_set_t pmr_set;
int retval;
@@ -127,7 +128,7 @@ static void classification_test_pmr_match_set_create(void)
CU_ASSERT(retval == 0);
}
-static void classification_test_pmr_match_set_destroy(void)
+void classification_test_pmr_match_set_destroy(void)
{
odp_pmr_set_t pmr_set;
int retval;
@@ -5,6 +5,7 @@
*/
#include "odp_classification_testsuites.h"
+#include "classification.h"
#include <odp_cunit_common.h>
#include <odp/helper/eth.h>
#include <odp/helper/ip.h>
@@ -564,7 +565,7 @@ void test_pktio_error_cos(void)
odp_packet_free(pkt);
}
-static void classification_test_pktio_set_skip(void)
+void classification_test_pktio_set_skip(void)
{
int retval;
size_t offset = 5;
@@ -581,7 +582,7 @@ static void classification_test_pktio_set_skip(void)
CU_ASSERT(retval == 0);
}
-static void classification_test_pktio_set_headroom(void)
+void classification_test_pktio_set_headroom(void)
{
size_t headroom;
int retval;
@@ -793,7 +794,7 @@ void test_pktio_pmr_match_set_cos(void)
odp_packet_free(pkt);
}
-static void classification_test_pmr_terms_avail(void)
+void classification_test_pmr_terms_avail(void)
{
int retval;
/* Since this API called at the start of the suite the return value
@@ -802,7 +803,7 @@ static void classification_test_pmr_terms_avail(void)
CU_ASSERT(retval > 0);
}
-static void classification_test_pmr_terms_cap(void)
+void classification_test_pmr_terms_cap(void)
{
unsigned long long retval;
/* Need to check different values for different platforms */
@@ -810,7 +811,7 @@ static void classification_test_pmr_terms_cap(void)
CU_ASSERT(retval | (1 << ODP_PMR_IPPROTO));
}
-static void classification_test_pktio_configure(void)
+void classification_test_pktio_configure(void)
{
/* Configure the Different CoS for the pktio interface */
if (TEST_DEFAULT)
@@ -827,7 +828,7 @@ static void classification_test_pktio_configure(void)
configure_pktio_pmr_match_set_cos();
}
-static void classification_test_pktio_test(void)
+void classification_test_pktio_test(void)
{
/* Test Different CoS on the pktio interface */
if (TEST_DEFAULT)
test symbols are now exported in the module lib. Signed-off-by: Christophe Milard <christophe.milard@linaro.org> --- test/validation/classification/classification.c | 2 +- test/validation/classification/classification.h | 31 ++++++++++++++++++++++ .../classification/odp_classification_basic.c | 17 ++++++------ .../classification/odp_classification_tests.c | 13 ++++----- 4 files changed, 48 insertions(+), 15 deletions(-)