diff --git a/cmake_targets/autotests/run_exec_autotests.bash b/cmake_targets/autotests/run_exec_autotests.bash index c00500cfc3695e1a0a6c1461c2b2eec4227b9783..fd5cc45e7775f9112ed8d831bd0c26155a8940f2 100755 --- a/cmake_targets/autotests/run_exec_autotests.bash +++ b/cmake_targets/autotests/run_exec_autotests.bash @@ -1,4 +1,5 @@ #!/bin/bash +#set -xv #/* # * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more # * contributor license agreements. See the NOTICE file distributed with @@ -92,78 +93,55 @@ function test_run() { tags_array_index=0 for main_exec_args_array_index in "${main_exec_args_array[@]}" do - global_result=1 + global_result=PASS result_string="" PROPER_DESC=`echo ${desc_array[$tags_array_index]} | sed -e "s@^.*Test cases.*(Test@Test@" -e "s@^ *(@@" -e"s/)$//" -e "s/),$//"` echo_info "$PROPER_DESC" for (( run_index=1; run_index <= $nruns; run_index++ )) do - temp_exec_log=$log_dir/test.$test_case_name.${tags_array[$tags_array_index]}.run_$run_index - echo "" > $temp_exec_log - + temp_exec_log="$log_dir/test.$test_case_name.${tags_array[$tags_array_index]}.run_$run_index" echo "Executing test case $test_case_name.${tags_array[$tags_array_index]}, Run Index = $run_index, Execution Log file = $temp_exec_log" - echo "-----------------------------------------------------------------------------" >> $temp_exec_log 2>&1 - echo "<EXECUTION LOG Test Case = $test_case_name.${tags_array[$tags_array_index]}, Run = $run_index >" >> $temp_exec_log 2>&1 - echo "Executing $main_exec $main_exec_args_array_index " | tee $temp_exec_log - { uname -a ; eval "$main_exec $main_exec_args_array_index" ;} >> $temp_exec_log 2>&1 + echo "-----------------------------------------------------------------------------" > "$temp_exec_log" + echo "<EXECUTION LOG Test Case = $test_case_name.${tags_array[$tags_array_index]}, Run = $run_index >" >> "$temp_exec_log" + echo "Executing $main_exec $main_exec_args_array_index " >> "$temp_exec_log" + uname -a >> "$temp_exec_log" + "$main_exec" $main_exec_args_array_index >> "$temp_exec_log" 2>&1 echo "</EXECUTION LOG Test Case = $test_case_name.${tags_array[$tags_array_index]}, Run = $run_index >" >> $temp_exec_log 2>&1 cat $temp_exec_log >> $log_file 2>&1 - result=1 + result=PASS for search_expr in "${search_expr_array[@]}" do - - search_result=`grep -E "$search_expr" $temp_exec_log` - - if [ -z "$search_result" ]; then - let "result = result & 0" - else - let "result = result & 1" - fi + grep -Eq "$search_expr" $temp_exec_log || result=FAIL done #If we find a negative search result then there is crash of program and test case is failed even if above condition is true - search_result=`grep -iE "$search_expr_negative" $temp_exec_log` - if [ -n "$search_result" ]; then - result=0 - fi - let "global_result = global_result & result" - - #echo "result = $result" - - if [ "$result" -eq "0" ]; then - result_string=$result_string" Run_$run_index =FAIL" + grep -q -iE "$search_expr_negative" $temp_exec_log && result=FAIL + + if [ "$result" != PASS ]; then echo_error "$test_case_name.${tags_array[$tags_array_index]} RUN = $run_index Result = FAIL" - fi - - if [ "$result" -eq "1" ]; then - result_string=$result_string" Run_$run_index =PASS" + else echo_success "$test_case_name.${tags_array[$tags_array_index]} RUN = $run_index Result = PASS" fi + result_string=$result_string" Run_$run_index =$result" + if [ $result != PASS ] ; then + global_result = FAIL + fi done #End of for loop (nindex) - echo " Result String = $result_string" - - if [ "$result_string" == "" ]; then - echo_error "execution $test_case_name.${tags_array[$tags_array_index]} {$PROPER_DESC} Run_Result = \"$result_string\" Result = FAIL" - xUnit_fail "execution" "$test_case_name.${tags_array[$tags_array_index]}" "FAIL" "$result_string" "$xmlfile_testcase" "$PROPER_DESC" - else - if [ "$global_result" == "0" ]; then + if [ "$global_result" != PASS ]; then echo_error "execution $test_case_name.${tags_array[$tags_array_index]} {$PROPER_DESC} Run_Result = \"$result_string\" Result = FAIL" xUnit_fail "execution" "$test_case_name.${tags_array[$tags_array_index]}" "FAIL" "$result_string" "$xmlfile_testcase" "$PROPER_DESC" - fi - - if [ "$global_result" == "1" ]; then + else echo_success "execution $test_case_name.${tags_array[$tags_array_index]} {$PROPER_DESC} Run_Result = \"$result_string\" Result = PASS " xUnit_success "execution" "$test_case_name.${tags_array[$tags_array_index]}" "PASS" "$result_string" "$xmlfile_testcase" "$PROPER_DESC" fi - fi let "tags_array_index++" done diff --git a/openair1/SIMULATION/TOOLS/multipath_channel.c b/openair1/SIMULATION/TOOLS/multipath_channel.c index c1bc2689168e60ec4d1b5996cabc998e1bd206f9..992c6be4614aa7ed0c872c9921343944074a06a9 100644 --- a/openair1/SIMULATION/TOOLS/multipath_channel.c +++ b/openair1/SIMULATION/TOOLS/multipath_channel.c @@ -38,7 +38,7 @@ uint8_t multipath_channel_nosigconv(channel_desc_t *desc) //#define CHANNEL_SSE #ifdef CHANNEL_SSE -void multipath_channel(channel_desc_t *desc, +void __attribute__ ((no_sanitize_address)) multipath_channel(channel_desc_t *desc, double tx_sig_re[NB_ANTENNAS_TX][30720*2], double tx_sig_im[NB_ANTENANS_TX][30720*2], double rx_sig_re[NB_ANTENNAS_RX][30720*2], @@ -170,7 +170,7 @@ void add_noise(c16_t **rxdata, } } -void multipath_channel(channel_desc_t *desc, +void __attribute__ ((no_sanitize_address)) multipath_channel(channel_desc_t *desc, double *tx_sig_re[NB_ANTENNAS_TX], double *tx_sig_im[NB_ANTENNAS_TX], double *rx_sig_re[NB_ANTENNAS_RX], @@ -180,9 +180,6 @@ void multipath_channel(channel_desc_t *desc, int log_channel) { - int i,ii,j,l; - struct complexd rx_tmp,tx; - double path_loss = pow(10,desc->path_loss_dB/20); int dd; dd = abs(desc->channel_offset); @@ -204,29 +201,24 @@ void multipath_channel(channel_desc_t *desc, } #endif - for (i=0; i<((int)length-dd); i++) { - for (ii=0; ii<desc->nb_rx; ii++) { - rx_tmp.r = 0; - rx_tmp.i = 0; - - for (j=0; j<desc->nb_tx; j++) { - for (l = 0; l<(int)desc->channel_length; l++) { + for (int i=0; i<((int)length-dd); i++) { + for (int ii=0; ii<desc->nb_rx; ii++) { + struct complexd rx_tmp={0}; + for (int j=0; j<desc->nb_tx; j++) { + struct complexd *chan=desc->ch[ii+(j*desc->nb_rx)]; + for (int l = 0; l<(int)desc->channel_length; l++) { if ((i>=0) && (i-l)>=0) { + struct complexd tx; tx.r = tx_sig_re[j][i-l]; tx.i = tx_sig_im[j][i-l]; - } else { - tx.r =0; - tx.i =0; + rx_tmp.r += (tx.r * chan[l].r) - (tx.i * chan[l].i); + rx_tmp.i += (tx.i * chan[l].r) + (tx.r * chan[l].i); } - - rx_tmp.r += (tx.r * desc->ch[ii+(j*desc->nb_rx)][l].r) - (tx.i * desc->ch[ii+(j*desc->nb_rx)][l].i); - rx_tmp.i += (tx.i * desc->ch[ii+(j*desc->nb_rx)][l].r) + (tx.r * desc->ch[ii+(j*desc->nb_rx)][l].i); - if (i==0 && log_channel == 1) { printf("channel[%d][%d][%d] = %f dB \t(%e, %e)\n", - ii, j, l, 10*log10(pow(desc->ch[ii+(j*desc->nb_rx)][l].r,2.0)+pow(desc->ch[ii+(j*desc->nb_rx)][l].i,2.0)), - desc->ch[ii+(j*desc->nb_rx)][l].r, - desc->ch[ii+(j*desc->nb_rx)][l].i); + ii, j, l, 10*log10(pow(chan[l].r,2.0)+pow(chan[l].i,2.0)), + chan[l].r, + chan[l].i); } } //l } // j diff --git a/openair1/SIMULATION/TOOLS/rangen_double.c b/openair1/SIMULATION/TOOLS/rangen_double.c index 20bd9c1ecb030cc8a3952b16faa5036dd8eff2aa..8f6f1bdfd93293c53f6b6f52eb56cd11940eeca9 100644 --- a/openair1/SIMULATION/TOOLS/rangen_double.c +++ b/openair1/SIMULATION/TOOLS/rangen_double.c @@ -86,7 +86,7 @@ double uniformrandom(void) /*!\brief Gaussian random number generator based on modified Box-Muller transformation.Returns a double-precision floating-point number. */ -double gaussdouble(double mean, double variance) +double __attribute__ ((no_sanitize_address)) gaussdouble(double mean, double variance) { static int iset=0; static double gset; @@ -175,7 +175,7 @@ void tableNor(unsigned long seed) return; } -double gaussZiggurat(double mean, double variance) +double __attribute__ ((no_sanitize_address)) gaussZiggurat(double mean, double variance) { hz = SHR3; iz = hz & 127;