Update of the getURL test due to the recent changes 60/11160/2
Sylvestre Ledru [Fri, 29 Mar 2013 09:07:37 +0000 (10:07 +0100)]
Change-Id: I685ccf4e425bba642e2633b1a3971b7b0411dabf

scilab/modules/fileio/sci_gateway/c/sci_getURL.c
scilab/modules/fileio/tests/unit_tests/getURL.dia.ref
scilab/modules/fileio/tests/unit_tests/getURL.tst

index 56965cb..127630c 100644 (file)
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2011 - DIGITEO - Sylvestre LEDRU
+ * Copyright (C) 2013 - Scilab Enterprises - Sylvestre LEDRU
  * Copyright (C) 2013 - Scilab Enterprises - Antoine ELIAS
  *
  * This file must be used under the terms of the CeCILL.
index 4797eeb..f6fdad6 100644 (file)
@@ -55,3 +55,29 @@ assert_checktrue(grep(mgetl(f1),"authenticated") <> []);
 mclose(f1);
 // Badly formated URL
 assert_checkerror("getURL(''http://plop@ae:www.scilab.org:80'');", [], 999);
+[f, HTMLContent]=getURL("http://www.scilab.org:80");
+assert_checktrue(length(HTMLContent) > 10);
+assert_checktrue(grep(HTMLContent,"html") <> []);
+[f, HTMLContent]=getURL("http://plop:ae@www.scilab.org:80");
+assert_checktrue(length(HTMLContent) > 10);
+assert_checktrue(grep(HTMLContent,"html") <> []);
+[f, HTMLContent]=getURL("http://www.scilab.org/aze");
+assert_checktrue(length(HTMLContent) > 10);
+assert_checkequal(grep(HTMLContent,"404"), []);
+[f, HTMLContent]=getURL("http://www.scilab.org");
+assert_checktrue(length(HTMLContent) > 10);
+assert_checktrue(grep(HTMLContent,"html") <> []);
+[f, HTMLContent]=getURL("http://www.scilab.org/");
+assert_checktrue(length(HTMLContent) > 10);
+assert_checktrue(grep(HTMLContent,"html") <> []);
+[f, HTMLContent]=getURL("ftp://ftp.free.fr/pub/Distributions_Linux/debian/README");
+assert_checktrue(length(HTMLContent) > 0);
+assert_checktrue(grep(HTMLContent,"Linux") <> []);
+// HTTPS
+[f, HTMLContent]=getURL("https://encrypted.google.com");
+assert_checktrue(length(HTMLContent) > 100);
+[f, HTMLContent]=getURL("http://httpbin.org/basic-auth/user/passwd",TMPDIR,"user","passwd");
+assert_checktrue(length(HTMLContent) > 10);
+assert_checktrue(grep(HTMLContent,"authenticated") <> []);
+// Badly formated URL
+assert_checkerror("getURL(''http://plop@ae:www.scilab.org:80'');", [], 999);
index 6f38c12..5ee55bf 100644 (file)
@@ -96,7 +96,7 @@ assert_checktrue(grep(HTMLContent,"Linux") <> []);
 [f, HTMLContent]=getURL("https://encrypted.google.com");
 assert_checktrue(length(HTMLContent) > 100);
 
-[f, HTMLContent]=getURL("http://httpbin.org/basic-auth/user/passwd","user","passwd");
+[f, HTMLContent]=getURL("http://httpbin.org/basic-auth/user/passwd",TMPDIR,"user","passwd");
 assert_checktrue(length(HTMLContent) > 10);
 assert_checktrue(grep(HTMLContent,"authenticated") <> []);