Permalink
Browse files

test IPTVChannelFetcher::ParsePlaylist

  • Loading branch information...
1 parent c24e2e7 commit b94a07fb59f7349d97d494a8372dedaa7a97f10a @dekarl dekarl committed Mar 5, 2014
@@ -21,6 +21,7 @@
#include <QtTest/QtTest>
#include "iptvtuningdata.h"
+#include "channelscan/iptvchannelfetcher.h"
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
#define MSKIP(MSG) QSKIP(MSG, SkipSingle)
@@ -79,4 +80,46 @@ class TestIPTVRecorder: public QObject
tuning.m_data_url = QUrl (QString("udp:[ff08::1%eth0]"));
QVERIFY (tuning.IsValid());
}
+
+ /**
+ * Test parsing a playlist
+ */
+ void ParseChanInfo(void)
+ {
+ /* #12077 - DVB with Neutrino - Sweden */
+ QString rawdataHTTP ("#EXTM3U\n"
+ "#EXTINF:0,1 - SVT1 HD Mitt\n"
+ "#EXTMYTHTV:xmltvid=svt1hd.svt.se\n"
+ "#EXTVLCOPT:program=1330\n"
+ "http://192.168.0.234:8001/1:0:19:532:6:22F1:EEEE0000:0:0:0:\n");
+
+
+
+ /* # - FreeboxTV - France - Free */
+ QString rawdataRTSP ("");
+
+ /* #11963 - Movistar TV - Spain - Telefonica */
+ QString rawdataUDP ("#EXTM3U\n"
+ "#EXTINF:0,001 - La 1\n"
+ "udp://239.0.0.76:8208\n");
+
+ fbox_chan_map_t chanmap;
+
+ /* test plain old MPEG-2 TS over multicast playlist */
+ chanmap = IPTVChannelFetcher::ParsePlaylist (rawdataUDP, NULL);
+ QCOMPARE (chanmap["001"].m_name, QString ("La 1"));
+ QVERIFY (chanmap["001"].IsValid ());
+ QVERIFY (chanmap["001"].m_tuning.IsValid ());
+ QCOMPARE (chanmap["001"].m_tuning.m_data_url.toString(), QString ("udp://239.0.0.76:8208"));
+ QCOMPARE (chanmap["001"].m_tuning.GetDataURL().toString(), QString ("udp://239.0.0.76:8208"));
+
+ /* test playlist for Neutrino STBs */
+ chanmap = IPTVChannelFetcher::ParsePlaylist (rawdataHTTP, NULL);
+ QVERIFY (chanmap["1"].IsValid ());
+ QVERIFY (chanmap["1"].m_tuning.IsValid ());
+ QCOMPARE (chanmap["1"].m_name, QString ("SVT1 HD Mitt"));
+ QCOMPARE (chanmap["1"].m_xmltvid, QString ("svt1hd.svt.se"));
+ QCOMPARE (chanmap["1"].m_programnumber, (uint) 1330);
+ QCOMPARE (chanmap["1"].m_tuning.m_data_url.toString(), QString ("http://192.168.0.234:8001/1:0:19:532:6:22F1:EEEE0000:0:0:0:"));
+ }
};
@@ -14,6 +14,9 @@ TARGET = test_iptvrecorder
DEPENDPATH += . ../..
INCLUDEPATH += . ../.. ../../mpeg ../../../libmythui ../../../libmyth ../../../libmythbase
+LIBS += ../../iptvchannelfetcher.o
+LIBS += ../../scanmonitor.o
+LIBS += ../../moc_scanmonitor.o
LIBS += -L../../../libmythbase -lmythbase-$$LIBVERSION
LIBS += -L../../../libmythui -lmythui-$$LIBVERSION
LIBS += -L../../../libmythupnp -lmythupnp-$$LIBVERSION

0 comments on commit b94a07f

Please sign in to comment.