aboutsummaryrefslogtreecommitdiffstats
path: root/tests/misc/misc_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/misc/misc_test.c')
-rw-r--r--tests/misc/misc_test.c62
1 files changed, 44 insertions, 18 deletions
diff --git a/tests/misc/misc_test.c b/tests/misc/misc_test.c
index c4d3a595..bbf75579 100644
--- a/tests/misc/misc_test.c
+++ b/tests/misc/misc_test.c
@@ -13,7 +13,7 @@
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
@@ -21,6 +21,7 @@
*/
#include <osmo-bts/bts.h>
+#include <osmo-bts/bts_sm.h>
#include <osmo-bts/msg_utils.h>
#include <osmo-bts/logging.h>
@@ -162,25 +163,50 @@ static void test_sacch_get(void)
static void test_bts_supports_cm(void)
{
+ struct rsl_ie_chan_mode cm;
struct gsm_bts *bts;
- bts = gsm_bts_alloc(ctx, 0);
-
- gsm_bts_set_feature(bts, BTS_FEAT_SPEECH_F_V1);
- gsm_bts_set_feature(bts, BTS_FEAT_SPEECH_H_V1);
- gsm_bts_set_feature(bts, BTS_FEAT_SPEECH_F_AMR);
- gsm_bts_set_feature(bts, BTS_FEAT_SPEECH_H_AMR);
-
- OSMO_ASSERT(bts_supports_cm
- (bts, GSM_PCHAN_TCH_F, GSM48_CMODE_SPEECH_V1) == 1);
- OSMO_ASSERT(bts_supports_cm
- (bts, GSM_PCHAN_TCH_H, GSM48_CMODE_SPEECH_V1) == 1);
- OSMO_ASSERT(bts_supports_cm
- (bts, GSM_PCHAN_TCH_F, GSM48_CMODE_SPEECH_EFR) == 0);
- OSMO_ASSERT(bts_supports_cm
- (bts, GSM_PCHAN_TCH_F, GSM48_CMODE_SPEECH_AMR) == 1);
- OSMO_ASSERT(bts_supports_cm
- (bts, GSM_PCHAN_TCH_H, GSM48_CMODE_SPEECH_AMR) == 1);
+ g_bts_sm = gsm_bts_sm_alloc(ctx);
+ bts = gsm_bts_alloc(g_bts_sm, 0);
+
+ /* Signalling shall be supported regardless of the features */
+ cm = (struct rsl_ie_chan_mode) { .chan_rt = RSL_CMOD_CRT_TCH_Bm,
+ .spd_ind = RSL_CMOD_SPD_SIGN };
+ OSMO_ASSERT(bts_supports_cm(bts, &cm) == true); /* TCH/F */
+
+ cm = (struct rsl_ie_chan_mode) { .chan_rt = RSL_CMOD_CRT_TCH_Lm,
+ .spd_ind = RSL_CMOD_SPD_SIGN };
+ OSMO_ASSERT(bts_supports_cm(bts, &cm) == true); /* TCH/H */
+
+ osmo_bts_set_feature(bts->features, BTS_FEAT_SPEECH_F_V1);
+ osmo_bts_set_feature(bts->features, BTS_FEAT_SPEECH_H_V1);
+ osmo_bts_set_feature(bts->features, BTS_FEAT_SPEECH_F_AMR);
+ osmo_bts_set_feature(bts->features, BTS_FEAT_SPEECH_H_AMR);
+
+ cm = (struct rsl_ie_chan_mode) { .chan_rt = RSL_CMOD_CRT_TCH_Bm,
+ .spd_ind = RSL_CMOD_SPD_SPEECH,
+ .chan_rate = RSL_CMOD_SP_GSM1 };
+ OSMO_ASSERT(bts_supports_cm(bts, &cm) == true); /* TCH/FS */
+
+ cm = (struct rsl_ie_chan_mode) { .chan_rt = RSL_CMOD_CRT_TCH_Lm,
+ .spd_ind = RSL_CMOD_SPD_SPEECH,
+ .chan_rate = RSL_CMOD_SP_GSM1 };
+ OSMO_ASSERT(bts_supports_cm(bts, &cm) == true); /* TCH/HS */
+
+ cm = (struct rsl_ie_chan_mode) { .chan_rt = RSL_CMOD_CRT_TCH_Bm,
+ .spd_ind = RSL_CMOD_SPD_SPEECH,
+ .chan_rate = RSL_CMOD_SP_GSM2 };
+ OSMO_ASSERT(bts_supports_cm(bts, &cm) == false); /* TCH/EFS */
+
+ cm = (struct rsl_ie_chan_mode) { .chan_rt = RSL_CMOD_CRT_TCH_Bm,
+ .spd_ind = RSL_CMOD_SPD_SPEECH,
+ .chan_rate = RSL_CMOD_SP_GSM3 };
+ OSMO_ASSERT(bts_supports_cm(bts, &cm) == true); /* TCH/AFS */
+
+ cm = (struct rsl_ie_chan_mode) { .chan_rt = RSL_CMOD_CRT_TCH_Lm,
+ .spd_ind = RSL_CMOD_SPD_SPEECH,
+ .chan_rate = RSL_CMOD_SP_GSM3 };
+ OSMO_ASSERT(bts_supports_cm(bts, &cm) == true); /* TCH/AHS */
talloc_free(bts);
}