X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=test%2Ftest_ctx_support.c;h=d15239a949177e4279ff508458bd5df531019ed8;hb=5ec64c5253b3b7611ec69cc1487989fae45eca26;hp=2a66c04d065ef6495eefdc01911a8963de458987;hpb=fcea3951d44de0cc55d33c5e114487abe79d3406;p=ric-plt%2Flib%2Frmr.git diff --git a/test/test_ctx_support.c b/test/test_ctx_support.c index 2a66c04..d15239a 100644 --- a/test/test_ctx_support.c +++ b/test/test_ctx_support.c @@ -61,15 +61,22 @@ static inline uta_ctx_t *mk_dummy_ctx() { if( ctx == NULL ) { return NULL; } - memset( ctx, 0, sizeof( *ctx ) ); + ctx->ephash = rmr_sym_alloc( 129 ); + ctx->mring = uta_mk_ring( 4096 ); // message ring is always on for si ctx->zcb_mring = uta_mk_ring( 128 ); // zero copy buffer mbuf ring to reduce malloc/free calls ctx->si_ctx = malloc( 1024 ); ctx->my_name = strdup( "hostname1" ); ctx->my_ip = strdup( "123.45.67.89" ); + ctx->rtgate = (pthread_mutex_t *) malloc( sizeof( *ctx->rtgate ) ); + if( ctx->rtgate != NULL ) { + pthread_mutex_init( ctx->rtgate, NULL ); + } + + return ctx; }