diff --git a/lib/src/phy/rf/rf_file_imp.c b/lib/src/phy/rf/rf_file_imp.c index b44d97bcb..bea7a84fb 100644 --- a/lib/src/phy/rf/rf_file_imp.c +++ b/lib/src/phy/rf/rf_file_imp.c @@ -172,7 +172,7 @@ int rf_file_open_multi(char* args, void** h, uint32_t nof_channels) FILE* rx_files[SRSRAN_MAX_CHANNELS] = {NULL}; FILE* tx_files[SRSRAN_MAX_CHANNELS] = {NULL}; - if (h && nof_channels < SRSRAN_MAX_CHANNELS) { + if (h && nof_channels <= SRSRAN_MAX_CHANNELS) { uint32_t base_srate = FILE_BASERATE_DEFAULT_HZ; // parse args diff --git a/lib/src/phy/rf/rf_file_test.c b/lib/src/phy/rf/rf_file_test.c index a16ea2821..a6e0b4bbb 100644 --- a/lib/src/phy/rf/rf_file_test.c +++ b/lib/src/phy/rf/rf_file_test.c @@ -228,6 +228,11 @@ void create_file(const char* filename) fclose(f); } +void remove_file(const char* filename) +{ + remove(filename); +} + int main() { // create files for testing @@ -306,6 +311,16 @@ int main() return -1; } + // clean workspace + remove_file("rx_file0"); + remove_file("rx_file1"); + remove_file("rx_file2"); + remove_file("rx_file3"); + remove_file("tx_file0"); + remove_file("tx_file1"); + remove_file("tx_file2"); + remove_file("tx_file3"); + fprintf(stdout, "Test passed!\n"); return SRSRAN_SUCCESS;