Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
jgaeddert committed Mar 17, 2024
2 parents 0172300 + 8c0ea76 commit e78ced9
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/modem/tests/cpfskmodem_autotest.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2007 - 2018 Joseph Gaeddert
* Copyright (c) 2007 - 2024 Joseph Gaeddert
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -171,7 +171,6 @@ void autotest_cpfskmodem_spectrum()
liquid_autotest_verbose ? filename : NULL);
}


// test errors and invalid configuration
void autotest_cpfskmodem_config()
{
Expand All @@ -189,13 +188,23 @@ void autotest_cpfskmodem_config()
CONTEND_ISNULL( cpfskmod_create(1, 0.5f, 5, 12, 0.25f, LIQUID_CPFSK_SQUARE) ); // _k is not even
CONTEND_ISNULL( cpfskmod_create(1, 0.5f, 4, 0, 0.25f, LIQUID_CPFSK_SQUARE) ); // _m is too small
CONTEND_ISNULL( cpfskmod_create(1, 0.5f, 4, 12, 0.00f, LIQUID_CPFSK_SQUARE) ); // _beta is too small
CONTEND_ISNULL( cpfskmod_create(1, 0.5f, 4, 12, 0.00f, -1) ); // invalid filter type

CONTEND_ISNULL( cpfskdem_create(0, 0.5f, 4, 12, 0.25f, LIQUID_CPFSK_SQUARE) ); // _bps is less than 1
CONTEND_ISNULL( cpfskdem_create(1, 0.0f, 4, 12, 0.25f, LIQUID_CPFSK_SQUARE) ); // _h (mod index) is out of range
CONTEND_ISNULL( cpfskdem_create(1, 0.5f, 5, 12, 0.25f, LIQUID_CPFSK_SQUARE) ); // _k is not even
CONTEND_ISNULL( cpfskdem_create(1, 0.5f, 4, 0, 0.25f, LIQUID_CPFSK_SQUARE) ); // _m is too small
CONTEND_ISNULL( cpfskdem_create(1, 0.5f, 4, 12, 0.00f, LIQUID_CPFSK_SQUARE) ); // _beta is too small
CONTEND_ISNULL( cpfskdem_create(1, 0.5f, 4, 12, 0.00f, -1) ); // invalid filter type

// create modulator object and check configuration
cpfskmod mod = cpfskmod_create(1, 0.5f, 4, 12, 0.5f, LIQUID_CPFSK_SQUARE);
CONTEND_EQUALITY( LIQUID_OK, cpfskmod_print(mod) );
cpfskmod_destroy(mod);

// TODO: create object and check configuration
// create demodulator object and check configuration
cpfskdem dem = cpfskdem_create(1, 0.5f, 4, 12, 0.5f, LIQUID_CPFSK_SQUARE);
CONTEND_EQUALITY( LIQUID_OK, cpfskdem_print(dem) );
cpfskdem_destroy(dem);
}

0 comments on commit e78ced9

Please sign in to comment.