spice-common/tests
Frediano Ziglio d589542e04 test-quic: Add test cases for quic fuzzer
To use for start for the fuzzer.

Tests have been generated with a patch like:

	diff --git a/tests/test-quic.c b/tests/test-quic.c
	--- a/tests/test-quic.c
	+++ b/tests/test-quic.c
	@@ -372,8 +372,8 @@ static void pixbuf_compare(GdkPixbuf *pixbuf_a, GdkPixbuf *pixbuf_b)
	 static GdkPixbuf *pixbuf_new_random(int alpha)
	 {
	     gboolean has_alpha = alpha >= 0 ? alpha : g_random_boolean();
	-    gint width = g_random_int_range(100, 2000);
	-    gint height = g_random_int_range(100, 500);
	+    gint width = g_random_int_range(10, 100);
	+    gint height = g_random_int_range(10, 100);
	     GdkPixbuf *random_pixbuf;
	     guint i, size;
	     guint8 *pixels;
	@@ -401,6 +401,12 @@ static void test_pixbuf(GdkPixbuf *pixbuf)
	     compressed_data = quic_encode_from_pixbuf(pixbuf, imgbuf);

	     uncompressed_pixbuf = quic_decode_to_pixbuf(compressed_data);
	+    {
	+        static int num = 0;
	+        char fn[256];
	+        sprintf(fn, "test%d.quic", ++num);
	+        g_assert(g_file_set_contents(fn, (void *) compressed_data->data, compressed_data->len, NULL));
	+    }
	     image_buf_free(imgbuf, uncompressed_pixbuf);

	     //g_assert(memcmp(gdk_pixbuf_get_pixels(pixbuf), gdk_pixbuf_get_pixels(uncompressed_pixbuf), gdk_pixbuf_get_byte_length(uncompressed_pixbuf)));

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Uri Lublin <uril@redhat.com>
2020-09-17 06:46:57 +01:00
..
fuzzer-quic-testcases test-quic: Add test cases for quic fuzzer 2020-09-17 06:46:57 +01:00
helper-fuzzer-demarshallers.c helper-fuzzer-demarshallers: Provide replacement for ftello for MSVC 2020-08-10 09:55:31 +01:00
Makefile.am helper-fuzzer-demarshallers: Add an helper for fuzzy testing demarshallers code 2020-04-09 09:11:04 +01:00
meson.build build: Remove dependency to gio2 from common and server libraries 2020-04-26 16:50:00 +01:00
test-dummy-recorder.c agent-interface: introduce the core of the Agent Interface 2019-10-18 17:04:03 +01:00
test-logging.c test-logging: Do not use G_PASTE to join level 2020-03-19 14:47:08 +00:00
test-marshallers.c Do not check for HAVE_CONFIG_H 2019-05-02 09:33:05 +01:00
test-marshallers.h test-marshallers.proto: ArrayMessage: make space for name 2019-08-13 18:09:05 +01:00
test-marshallers.proto test-marshallers.proto: ArrayMessage: make space for name 2019-08-13 18:09:05 +01:00
test-quic.c test-quic: Add fuzzer capabilities to the test 2020-09-17 06:46:57 +01:00
test-region.c Do not check for HAVE_CONFIG_H 2019-05-02 09:33:05 +01:00
test-ssl-verify.c test-ssl-verify: Improve subject_to_x509_name coverage 2019-03-13 17:22:18 +00:00
test-utils.c test-utils: Add missing include file 2020-05-06 12:21:10 +01:00