X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=test%2Fring_static_test.c;h=bd2b42840ed830b60af5fb1f060e90536f450e4f;hb=dfe7b622b128e7bfb4a5e1f7e0afdb84e6001d14;hp=482244cc1a4cfcae2595a4261bbc1ab9cc426fdd;hpb=8dd46415b94b33fa960bdd5732e909ffc4859520;p=ric-plt%2Flib%2Frmr.git diff --git a/test/ring_static_test.c b/test/ring_static_test.c index 482244c..bd2b428 100644 --- a/test/ring_static_test.c +++ b/test/ring_static_test.c @@ -1,14 +1,14 @@ // : vi ts=4 sw=4 noet : /* ================================================================================== - Copyright (c) 2019 Nokia - Copyright (c) 2018-2019 AT&T Intellectual Property. + Copyright (c) 2019 Nokia + Copyright (c) 2018-2019 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. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, @@ -21,7 +21,7 @@ /* Mmemonic: ring_static_test.c Abstract: Test the ring funcitons. These are meant to be included at compile - time by the test driver. + time by the test driver. Author: E. Scott Daniels Date: 3 April 2019 @@ -34,16 +34,17 @@ #include #include #include +#include +#include -#include "../src/common/include/rmr.h" -#include "../src/common/include/rmr_agnostic.h" -//#include "../src/common/src/ring_static.c" +#include "rmr.h" +#include "rmr_agnostic.h" /* - Conduct a series of interleaved tests inserting i-factor + Conduct a series of interleaved tests inserting i-factor values before beginning to pull values (i-factor must be - size - 2 smaller than the ring. + size - 2 smaller than the ring. Returns 0 on success, 1 on insert failure and 2 on pull failure. */ static int ie_test( void* r, int i_factor, long inserts ) { @@ -118,7 +119,7 @@ static int ring_test( ) { } else { break; } - } + } if( *dp != i ) { fprintf( stderr, " data at i=% isnt right; expected %d got %d\n", i, i, *dp ); @@ -129,7 +130,7 @@ static int ring_test( ) { return 1; } fprintf( stderr, " extracted values were sane, got: %d\n", i-1 ); - + uta_ring_free( NULL ); // ensure this doesn't blow up uta_ring_free( r ); for( i = 2; i < 15; i++ ) { @@ -151,7 +152,7 @@ static int ring_test( ) { fprintf( stderr, " ie test for 66K inserts didn't return 0\n" ); return 1; } - + uta_ring_free( r ); } fprintf( stderr, " all large insert/exctract tests pass ring size=%d\n", size );