summaryrefslogtreecommitdiff
path: root/test/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'test/cmd')
-rw-r--r--test/cmd/fdt.c1
-rw-r--r--test/cmd/hash.c1
-rw-r--r--test/cmd/mem_copy.c1
-rw-r--r--test/cmd/mem_search.c1
-rw-r--r--test/cmd/setexpr.c1
-rw-r--r--test/cmd/wget.c20
6 files changed, 25 insertions, 0 deletions
diff --git a/test/cmd/fdt.c b/test/cmd/fdt.c
index c11c181c807..96a8488e172 100644
--- a/test/cmd/fdt.c
+++ b/test/cmd/fdt.c
@@ -6,6 +6,7 @@
*/
#include <console.h>
+#include <env.h>
#include <fdt_support.h>
#include <mapmem.h>
#include <asm/global_data.h>
diff --git a/test/cmd/hash.c b/test/cmd/hash.c
index 296dd762b31..bb96380c351 100644
--- a/test/cmd/hash.c
+++ b/test/cmd/hash.c
@@ -6,6 +6,7 @@
*/
#include <command.h>
+#include <env.h>
#include <dm.h>
#include <dm/test.h>
#include <test/test.h>
diff --git a/test/cmd/mem_copy.c b/test/cmd/mem_copy.c
index 3e904fc4e4b..8e551f18a85 100644
--- a/test/cmd/mem_copy.c
+++ b/test/cmd/mem_copy.c
@@ -4,6 +4,7 @@
*/
#include <command.h>
+#include <compiler.h>
#include <console.h>
#include <mapmem.h>
#include <dm/test.h>
diff --git a/test/cmd/mem_search.c b/test/cmd/mem_search.c
index df8938bdb6c..61de0dfb9a9 100644
--- a/test/cmd/mem_search.c
+++ b/test/cmd/mem_search.c
@@ -7,6 +7,7 @@
*/
#include <console.h>
+#include <env.h>
#include <mapmem.h>
#include <dm/test.h>
#include <test/ut.h>
diff --git a/test/cmd/setexpr.c b/test/cmd/setexpr.c
index 85803eb54b8..93b0c4b68f5 100644
--- a/test/cmd/setexpr.c
+++ b/test/cmd/setexpr.c
@@ -7,6 +7,7 @@
*/
#include <console.h>
+#include <env.h>
#include <mapmem.h>
#include <dm/test.h>
#include <test/ut.h>
diff --git a/test/cmd/wget.c b/test/cmd/wget.c
index 445750660c2..1005392b952 100644
--- a/test/cmd/wget.c
+++ b/test/cmd/wget.c
@@ -241,3 +241,23 @@ static int net_test_wget(struct unit_test_state *uts)
return 0;
}
CMD_TEST(net_test_wget, UTF_CONSOLE);
+
+static int net_test_wget_uri_validate(struct unit_test_state *uts)
+{
+ ut_asserteq(true, wget_validate_uri("http://foo.com/bar.html"));
+ ut_asserteq(true, wget_validate_uri("http://1.1.2.3/bar.html"));
+ ut_asserteq(false, wget_validate_uri("http://foo/ba r.html"));
+ ut_asserteq(false, wget_validate_uri("http://"));
+
+ if (CONFIG_IS_ENABLED(WGET_HTTPS)) {
+ ut_asserteq(true,
+ wget_validate_uri("https://foo.com/bar.html"));
+ ut_asserteq(true,
+ wget_validate_uri("https://1.1.2.3/bar.html"));
+ ut_asserteq(false, wget_validate_uri("https://foo/ba r.html"));
+ ut_asserteq(false, wget_validate_uri("https://"));
+ }
+
+ return 0;
+}
+CMD_TEST(net_test_wget_uri_validate, UTF_CONSOLE);