On 02/03/2015 12:39 PM, Mike Holmes wrote:


On 3 February 2015 at 04:54, Taras Kondratiuk
<[email protected] <mailto:[email protected]>> wrote:

    On 02/03/2015 12:02 AM, Mike Holmes wrote:

        init_global can only be called once per executable, split the
        init_global testing into multiple executables.

        Signed-off-by: Mike Holmes <[email protected]
        <mailto:[email protected]>>
        ---
        v2
        fix copyright year
        remove uneeded defines

           test/validation/Makefile.am    |  4 +--
           test/validation/odp_init.c     | 39 ---------------------
           test/validation/odp_init_log.c | 78
        ++++++++++++++++++++++++++++++__++++++++++++
           3 files changed, 80 insertions(+), 41 deletions(-)
           create mode 100644 test/validation/odp_init_log.c

        diff --git a/test/validation/Makefile.am
        b/test/validation/Makefile.am
        index 2942b85..3ee59c8 100644
        --- a/test/validation/Makefile.am
        +++ b/test/validation/Makefile.am
        @@ -6,10 +6,10 @@ AM_LDFLAGS += -static
           TESTS_ENVIRONMENT = ODP_PLATFORM=${with_platform}

           if test_vald
        -TESTS = odp_init odp_queue odp_crypto odp_shm odp_schedule
        odp_pktio_run odp_buffer odp_system odp_timer odp_time
        odp_synchronizers odp_classification
        +TESTS = odp_init odp_init_log odp_queue odp_crypto odp_shm
        odp_schedule odp_pktio_run odp_buffer odp_system odp_timer
        odp_time odp_synchronizers odp_classification
           endif

        -bin_PROGRAMS = odp_init odp_queue odp_crypto odp_shm
        odp_schedule odp_pktio odp_buffer odp_system odp_timer odp_time
        odp_synchronizers odp_classification
        +bin_PROGRAMS = odp_init odp_init_log odp_queue odp_crypto
        odp_shm odp_schedule odp_pktio odp_buffer odp_system odp_timer
        odp_time odp_synchronizers odp_classification
           odp_crypto_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/crypto
           odp_buffer_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/buffer
           odp_classification_CFLAGS = $(AM_CFLAGS)
        -I$(srcdir)/classification
        diff --git a/test/validation/odp_init.c b/test/validation/odp_init.c
        index c8e5a11..82f8849 100644
        --- a/test/validation/odp_init.c
        +++ b/test/validation/odp_init.c
        @@ -11,10 +11,6 @@
           #define DEFAULT_MSG_POOL_SIZE (4*1024*1024)
           #define DEFAULT_MSG_SIZE      (8)

        -int replacement_logging_used;
        -
        -static int odp_init_log(odp_log_level_e level , const char
        *fmt, ...);
        -
           static void test_odp_init_global(void)
           {
                 int status;
        @@ -25,27 +21,8 @@ static void test_odp_init_global(void)
                 CU_ASSERT(status == 0);
           }

        -static void test_odp_init_global_replace___log(void)
        -{
        -       int status;
        -       struct odp_init_t init_data;
        -
        -       init_data.log_fn = &odp_init_log;
        -
        -       replacement_logging_used = 0;
        -
        -       status = odp_init_global(&init_data, NULL);
        -       CU_ASSERT_FATAL(status == 0);
        -
        -       CU_ASSERT_TRUE(replacement___logging_used);


    For replacement_logging_used to be true implementation have to call
    log function at least once in odp_init_global(). Maybe add a note just
    above to make this assumption is obvious?
    It would be even better to explicitly call some odp_*_print() function
    before, to be sure that log function is called.


That will be a change to what is checked in, this was to just split
things as they were.
The init_global print a lot of stuff as it is, can altering it be a
follow on?

Yes that can be a follow up.

Reviewed-by: Taras Kondratiuk <[email protected]>


It currently prints things like
odp_buffer_pool.c:91:odp_buffer_pool_init_global():  pool_entry_s size
   320
odp_buffer_pool.c:92:odp_buffer_pool_init_global():  pool_entry_t size
   320
odp_buffer_pool.c:93:odp_buffer_pool_init_global():  odp_buffer_hdr_t
size 112
odp_buffer_pool.c:94:odp_buffer_pool_init_global():

It is an assumption made by this test, but not all implementations print
something on global init.

_______________________________________________
lng-odp mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to