tests/media.c: Add test_media_escaped_utf8_url
authorToni Gundogdu <legatvs@gmail.com>
Mon, 14 Oct 2013 13:34:10 +0000 (14 16:34 +0300)
committerToni Gundogdu <legatvs@gmail.com>
Tue, 15 Oct 2013 14:37:04 +0000 (15 17:37 +0300)
Signed-off-by: Toni Gundogdu <legatvs@gmail.com>
tests/media.c

index f7aa3fd..8af0777 100644 (file)
@@ -354,6 +354,31 @@ static void test_media_escaped_url()
   quvi_free(q);
 }
 
+static void test_media_escaped_utf8_url()
+{
+  static gchar URL[] =
+    "http://flix.tapuz.co.il/v/watch-4323227-%D7%9C%D7%A2%D7%A7%D7%95%D7%A8%20%D7%A9%D7%9F%20%D7%9C%D7%98%D7%99%D7%92%D7%A8%D7%99%D7%A1.html";
+
+  quvi_media_t qm;
+  quvi_t q;
+
+  if (chk_internet() == FALSE || chk_skip(__func__) == TRUE)
+    return;
+
+  q = quvi_new();
+  g_assert(q != NULL);
+  g_assert_cmpint(quvi_errcode(q), ==, QUVI_OK);
+
+  chk_verbose(q);
+
+  qm = quvi_media_new(q, URL);
+  g_assert_cmpint(qerr_m(q, URL), ==, QUVI_OK);
+  g_assert(qm != NULL);
+
+  quvi_media_free(qm);
+  quvi_free(q);
+}
+
 static void test_media_nosupport()
 {
   static const gchar URL[] = "http://example.com";
@@ -423,6 +448,8 @@ gint main(gint argc, gchar **argv)
   g_test_add_func("/quvi/media (select)", test_media_select);
   g_test_add_func("/quvi/media (short)", test_media_short);
   g_test_add_func("/quvi/media (escaped URL)", test_media_escaped_url);
+  g_test_add_func("/quvi/media (escaped UTF8 URL)",
+                  test_media_escaped_utf8_url);
   g_test_add_func("/quvi/media (nosupport)", test_media_nosupport);
   g_test_add_func("/quvi/media (start_time)", test_media_starttime);
   g_test_add_func("/quvi/media (same handle)", test_media_same_q);