X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=test%2Frt_static_test.c;h=6973a7992c94974bcf884a3806f1e666cc13a925;hb=refs%2Fchanges%2F41%2F11241%2F1;hp=7a51bca421051f175d858cc8e9e0d58f0fb75613;hpb=84423e66ad5d4ed313548b3705ec925a934b0f2e;p=ric-plt%2Flib%2Frmr.git diff --git a/test/rt_static_test.c b/test/rt_static_test.c index 7a51bca..6973a79 100644 --- a/test/rt_static_test.c +++ b/test/rt_static_test.c @@ -1,8 +1,9 @@ + // : vi ts=4 sw=4 noet : /* ================================================================================== - Copyright (c) 2019 Nokia - Copyright (c) 2018-2019 AT&T Intellectual Property. + Copyright (c) 2019-2021 Nokia + Copyright (c) 2018-2021 AT&T Intellectual Property. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -500,6 +501,10 @@ static int rt_test( ) { errors += fail_if_nil( ctx->rtable, "edge case route table didn't generate a pointer into the context" ); unsetenv( "RMR_SEED_RT" ); // remove for next read try + if( ctx && ctx->seed_rt_fname != NULL ) { + free( ctx->seed_rt_fname ); + ctx->seed_rt_fname = NULL; + } read_static_rt( ctx, 0 ); // drive for not there coverage } @@ -571,6 +576,10 @@ static int rt_test( ) { ctx->rtable = NULL; ctx->my_name = strdup( "my_host_name" ); // set up to load a rtable ctx->my_ip = strdup( "192.168.1.30" ); + if( ctx && ctx->seed_rt_fname != NULL ) { + free( ctx->seed_rt_fname ); + ctx->seed_rt_fname = NULL; + } gen_rt( ctx ); // generate a route table with meid entries and hang off ctx mbuf = rmr_alloc_msg( ctx, 2048 ); // buffer to play with @@ -705,5 +714,5 @@ static int rt_test( ) { // ------ specific edge case tests ------------------------------------------------------------------------------- errors += lg_clone_test( ); - return !!errors; // 1 or 0 regardless of count + return errors; // 1 or 0 regardless of count }