codec_pref: also check physical channels

At the moment codec_pref only checks the codec configuration, but it
does not check if there is actually a matching physical channel
available. This should be checked too we must make sure that the codec
we select fits the physical channels available on the BTS.

Change-Id: I2d29dfed450e5ef93c26ed5ec9fdc0730eb3d7dd
Related: OS#3503
diff --git a/tests/codec_pref/codec_pref_test.c b/tests/codec_pref/codec_pref_test.c
index e2876e2..534b99e 100644
--- a/tests/codec_pref/codec_pref_test.c
+++ b/tests/codec_pref/codec_pref_test.c
@@ -294,6 +294,7 @@
 	/* Note: FR is supported by all BTSs, so there is no flag for it */
 
 	struct gsm48_multi_rate_conf *cfg;
+	static struct gsm_bts_trx trx;
 
 	OSMO_ASSERT(config_no < N_CONFIG_VARIANTS);
 
@@ -324,6 +325,13 @@
 	cfg->m10_2 = 0;
 	cfg->m12_2 = 0;
 
+	/* Initalize TRX with a TCH/F and a TCH/H channel */
+	memset(&trx, 0, sizeof(trx));
+	INIT_LLIST_HEAD(&bts->trx_list);
+	llist_add(&trx.list, &bts->trx_list);
+	trx.ts[0].pchan_from_config = GSM_PCHAN_TCH_F;
+	trx.ts[1].pchan_from_config = GSM_PCHAN_TCH_H;
+
 	switch (config_no) {
 	case 0:
 		/* FR1 (implicit) only */