Modify nr_dlsim, nr_pbchsim and nr_pucchsim to return '0' on success

- Change return value of nr_dlsim, nr_pbchsim and nr_pucchsim to:
  - Return '0' if test succeeds (indicated also by "PDSCH/PBCH/PUCCH test
    OK" in the test log).
  - Return '1' if test fails.
This commit is contained in:
Jaroslava Fiedlerova
2025-05-16 13:42:23 +02:00
parent 8ca6a4a06e
commit 2402f37271
3 changed files with 9 additions and 6 deletions
+3 -4
View File
@@ -943,8 +943,7 @@ printf("%d\n", slot);
nr_ue_phy_config_request(&UE_mac->phy_config);
//NR_COMMON_channels_t *cc = RC.nrmac[0]->common_channels;
int n_errs = 0;
int ret = 1;
initNamedTpool(gNBthreads, &gNB->threadPool, true, "gNB-tpool");
initNotifiedFIFO(&gNB->L1_tx_free);
initNotifiedFIFO(&gNB->L1_tx_filled);
@@ -1371,10 +1370,10 @@ printf("%d\n", slot);
if (effRate > (eff_tp_check*TBS)) {
printf("PDSCH test OK\n");
ret = 0;
break;
}
n_errs = n_errors[0];
} // NSR
free(Sched_INFO);
@@ -1423,7 +1422,7 @@ printf("%d\n", slot);
free(filename_csv);
}
return n_errs;
return ret;
}
+3 -1
View File
@@ -146,6 +146,7 @@ int main(int argc, char **argv)
// int subframe_offset;
// char fname[40], vname[40];
int trial,n_trials=1,n_errors=0,n_errors_payload=0;
int ret_test = 1;
uint8_t transmission_mode = 1,n_tx=1,n_rx=1;
uint16_t Nid_cell=0;
uint64_t SSB_positions=0x01;
@@ -771,6 +772,7 @@ int main(int argc, char **argv)
if (((float)n_errors/(float)n_trials <= target_error_rate) && (n_errors_payload==0)) {
printf("PBCH test OK\n");
ret_test = 0;
break;
}
@@ -816,6 +818,6 @@ int main(int argc, char **argv)
loader_reset();
logTerm();
return(n_errors);
return ret_test;
}
+3 -1
View File
@@ -109,6 +109,7 @@ int main(int argc, char **argv)
//int subframe_offset;
//char fname[40], vname[40];
int trial,n_trials=100,n_errors=0,ack_nack_errors=0,sr_errors=0;
int ret = 1;
uint8_t transmission_mode = 1,n_tx=1,n_rx=1;
uint16_t Nid_cell=0;
uint64_t SSB_positions=0x01;
@@ -758,6 +759,7 @@ int main(int argc, char **argv)
printf("ACK/NACK: SNR=%f, n_trials=%d, n_bit_errors=%d\n",SNR,n_trials,ack_nack_errors);
if((float)(ack_nack_errors+sr_errors)/(float)(n_trials)<=target_error_rate){
printf("PUCCH test OK\n");
ret = 0;
break;
}
}
@@ -799,5 +801,5 @@ int main(int argc, char **argv)
loader_reset();
logTerm();
return(n_errors);
return ret;
}