Commit Graph

41 Commits

Author SHA1 Message Date
Pavel Grunt
2528cd907b test-session: Fix comparison
The test was not executed because G_N_ELEMENTS is 0 for the pointer

Acked-by: Victor Toso <victortoso@redhat.com>
2016-10-19 15:05:32 +02:00
Pavel Grunt
7b6cd9613f test-session: Add IPv6 tests 2016-10-17 20:07:15 +02:00
Pavel Grunt
b8749cc053 test-session: Test invalid URIs 2016-10-17 20:07:15 +02:00
Pavel Grunt
7e010e76ff test-session: Also test hostname, username and password 2016-10-17 20:07:15 +02:00
Pavel Grunt
36f28f4e47 test-session: Test alternative way for setting port
Acked-by: Victor Toso <victortoso@redhat.com>
2016-10-17 20:07:15 +02:00
Victor Toso
6f11f55996 tests: fix -Wall -Wextra compiler warnings
With -Wall a few -Wunused-variable and -Wunused-but-set-variable;
With -Wextra lots of -Wunused-parameter and a few -Wsign-compare.

Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-10-05 14:15:08 +02:00
Victor Toso
c2c74cac75 tests: set binaries to have 'test' name prefix
To follow test-spice-uri and test-file-transfer standard.

Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-10-03 14:36:43 +02:00
Pavel Grunt
b708989b12 util: Remove unused GError parameter
The parameter is removed from functions:
 get_line
 spice_convert_newlines
 spice_unix2dos
 spice_dos2unix

It was introduced in 75f1ea3ee9
but never used

Acked-by: Marc-André Lureau <mlureau@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-09-02 13:14:17 +02:00
Christophe Fergeau
377842b94d test-file-transfer: Don't leak GError
Acked-by: Victor Toso <victortoso@redhat.com>
2016-08-03 15:27:27 +02:00
Christophe Fergeau
66d8e2ee50 test-file-transfer: Don't leak GFileInfo
The GFileInfo returned by spice_file_transfer_task_init_task_finish()
must be unref'ed when no longer needed.

Acked-by: Victor Toso <victortoso@redhat.com>
2016-08-03 15:27:24 +02:00
Victor Toso
95c570274f tests: file-transfer agent cancel
Agent only can only send error or cancel from a transfer operation
after it was initialized. From SpiceFileTransferTask point of view,
error and cancellation is an GError with different code so testing
only cancel seems enough.

Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-07-07 16:19:23 +02:00
Victor Toso
5dc16d27c0 tests: file-transfer cancel on read async
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-07-07 16:19:23 +02:00
Victor Toso
9d16aced7f tests: file-transfer cancel on task init
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-07-07 16:19:23 +02:00
Victor Toso
bee52d2ba7 tests: file-transfer include simple tests
This only includes a simple test for file-transfer with a small
summary of the possible situations of the test.

As the test is specifically for SpiceFileTransferTask, we don't create
a SpiceMainChannel.

Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-07-07 16:19:23 +02:00
Pavel Grunt
8cf25bea7b tests-uri: Define g_assert_nonnull
It is available since Glib 2.40
2016-06-13 13:07:47 +02:00
Pavel Grunt
b542dfa2d5 spice-uri: Add ipv6 support
Just basic support -  http://user:password@[host]:port

Resolves: rhbz#1335239
2016-06-02 10:26:10 +02:00
Pavel Grunt
8dcb4129ac spice-uri: Validate uri scheme
Related: rhbz#1335239

Acked-by: Victor Toso <victortoso@redhat.com>
2016-06-02 10:26:10 +02:00
Pavel Grunt
eacbe261d4 spice-uri: Check if port is in allowed range
Use g_ascii_strtoll because it helps to detect overflow.

Related: rhbz#1335239

Acked-by: Victor Toso <victortoso@redhat.com>
2016-06-02 10:26:10 +02:00
Pavel Grunt
85051b06c1 spice-uri: Do not allow empty port string
Related: rhbz#1335239

Acked-by: Victor Toso <victortoso@redhat.com>
2016-06-02 10:26:10 +02:00
Pavel Grunt
024eccefba spice-uri: Reset SpiceURI before parsing
Avoid using old values after parsing a new uri.

Related: rhbz#1335239
2016-06-02 10:26:10 +02:00
Pavel Grunt
dab190d8d2 tests: Add test for SpiceURI
Related: rhbz#1335239
2016-06-02 10:26:10 +02:00
Victor Toso
756f1fe8aa tests: fix build with smartcard enabled
In file included from
../spice-common/common/client_marshallers.h:29:0,
from ../src/spice-channel-priv.h:35,
from ../src/spice-file-transfer-task-priv.h:28,
from file-transfer.c:3:
../spice-common/common/messages.h:45:23: fatal error: libcacard.h: No such file or directory
compilation terminated.

Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-06-01 09:32:27 +02:00
Pavel Grunt
0a9ec4ec01 Adjust to GLib 2.36
Dependency since 8693e7d3f7

Remove glib-compat files and most of GLIB_CHECK_VERSION guards

Acked-by: Victor Toso <victortoso@redhat.com>
2016-03-18 11:42:31 +01:00
Marc-André Lureau
3c6b4ae867 build-sys: fix 'Only <spice-client.h> can be included directly' warning
Tests should be allowed to include directly private headers. Set
__SPICE_CLIENT_H_INSIDE__ where necessary or include spice-client.h
where possible.

Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2016-03-15 17:11:18 +01:00
Marc-André Lureau
0a1f9bfd29 build-sys: fix make check when polkit not available
acl-helper needs polkit (and unix atm) to build.

Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
2016-03-11 20:02:46 +01:00
Jonathon Jongsma
c1683c3463 Add tests for usb-acl-helper 2016-03-11 10:41:38 -06:00
Marc-André Lureau
caf28401ca Move gtk/ -> src/
For historical reasons, the code was placed under gtk/ subdirectory.
If it was always bugging you, bug no more!
2015-06-08 17:38:58 +02:00
Victor Toso
70cd7ee210 tests: add test to check for zombie GSources
Using g_pollable_input_stream_create_source to generage several dummy
GSources in order to check if giopipe sets all of them to be dispatched.

This test check for zombie GSources during a write_all/read_chunk
operation.
2015-06-05 09:22:32 +02:00
Victor Toso
b3234ab353 tests: add test to concurrent write to pipe
Concurrent write is not supported and should fail. The GIO error is
G_IO_ERROR_PENDING
2015-06-05 09:22:32 +02:00
Victor Toso
da01ae6622 tests: pipe using _write_all_async function 2015-06-05 09:22:32 +02:00
Victor Toso
e5d2047812 tests: remove read8_cb to use generic read_cb
Both functions are basic the same so let's keep the generic one.
2015-06-05 09:22:32 +02:00
Marc-André Lureau
62f40ab204 build-sys: fix out-of-tree build from tarball
There are generated files in build directory too. Fixes:

CC       util.o
In file included from ../../tests/session.c:3:0:
../../gtk/spice-session.h:24:30: fatal error: spice-glib-enums.h:
No such file or directory #include "spice-glib-enums.h"
2015-03-04 14:16:48 +01:00
Marc-André Lureau
4e9c936dc2 Add GIOStream-based pipe
This code creates a pipe between 2 GIOStream, the input side read from
the peer output side, and vice-versa.

In the following patches, this will avoid the socket communication
to exchange with the embedded webdav server.

glib-2.0 >= 2.43.90 because GSimpleIOStream dependency.
2015-03-03 14:11:58 +01:00
Victor Toso
ca59cb30c1 tests: add spice-session test
Checking if URIs are being parsed and generated correctly.
2015-02-27 17:00:07 +01:00
Marc-André Lureau
02fe4df154 build-sys: generate gitignore in tests dir 2014-10-30 13:51:51 +01:00
Pavel Grunt
457d556c00 Fix -Wsign-compare 2014-09-18 13:21:58 +02:00
Ryan Lortie
e189c97694 utils tests: fix sign comparison problem
This test compares a guint8 and a gchar with '==' which fails when comparing
240 to -16, even though these are the same byte value.  Add an explicit
'guchar' cast to correct the problem.

https://bugs.freedesktop.org/show_bug.cgi?id=74754
2014-02-10 14:38:57 +01:00
Marc-André Lureau
0eaf492097 test: fix a few compiler warnings
util.c: In function 'test_set_bit':
util.c:131:13: warning: pointer targets in initialization differ in signedness [-Wpointer-sign]
2014-02-07 13:55:57 +01:00
Marc-André Lureau
0ea5a6c8dc tests: add some coroutine tests 2013-11-20 16:32:07 +01:00
Alon Levy
11ddba4b09 channel-cursor: mono cursors edge highlighting
Fix 998529, mono (invert) cursors not visible on a black background, by doing
simple edge detection on the cursor (this is done once when the cursor
is changed and then cached, cursors are 32x32 generally) and thus having
a cursor with contrast on both dark and light backgrounds.

When (if) GDK gets invert cursor support (wayland?) then we can just use
the cursor as is. Until then X doesn't provide any way I see of solving
this otherwise. The end result was tested with the I beam cursor that
the original bug was referring to (run putty on a windows 7 vm) and
looks ok to me.

Moving the core function to spice-util for testing.
2013-10-20 00:31:32 +03:00
Marc-André Lureau
a5f9eb7644 tests: add some dos2unix tests
This is probably not exhaustive enough, but better than nothing.
2013-08-24 17:50:20 +02:00