[Spice-devel] [PATCH spice-gtk v2 4/4] tests: add spice+tls:// tests
Frediano Ziglio
fziglio at redhat.com
Wed Feb 21 09:17:56 UTC 2018
>
> From: Marc-André Lureau <marcandre.lureau at redhat.com>
>
> They couldn't not be introduced before, because the test needs both
> parsing and generation.
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau at redhat.com>
> ---
> tests/session.c | 24 +++++++++++++++++++++++-
> 1 file changed, 23 insertions(+), 1 deletion(-)
>
> diff --git a/tests/session.c b/tests/session.c
> index fc874fc..f0ecda2 100644
> --- a/tests/session.c
> +++ b/tests/session.c
> @@ -21,7 +21,7 @@ static void test_session_uri_bad(void)
> struct {
> const GLogLevelFlags log_level;
> const gchar *message;
> - } messages[2];
> + } messages[4];
> } uris[] = {
> {
> "scheme://host?port",
> @@ -111,6 +111,25 @@ static void test_session_uri_bad(void)
> "*assertion 's->port != NULL || s->tls_port != NULL'
> failed",
> },
> }
> + },{
> + "spice+tls://hostname?tls-port=1234&port=3456",
> + {
> + {
> + G_LOG_LEVEL_WARNING,
> + "spice+tls:// scheme doesn't accept 'tls-port'",
> + },
> + {
> + G_LOG_LEVEL_WARNING,
> + "spice+tls:// scheme doesn't accept 'port'",
> + },
> + {
> + G_LOG_LEVEL_WARNING,
> + "Missing port or tls-port in spice URI *",
> + },{
> + G_LOG_LEVEL_CRITICAL,
> + "*assertion 's->port != NULL || s->tls_port != NULL'
> failed",
> + },
> + }
> },
> };
>
> @@ -233,6 +252,9 @@ static void test_session_uri_ipv4_good(void)
> NULL, NULL,
> "spice://127.0.0.1:42?tls-port=5930",
> "spice://127.0.0.1?port=42&tls-port=5930" },
> + { .uri_input = "spice+tls://hostname:39",
> + .host = "hostname",
> + .tls_port = "39" }
> };
>
> test_session_uri_good(tests, G_N_ELEMENTS(tests));
Acked
Frediano
More information about the Spice-devel
mailing list