summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlon Levy <alevy@redhat.com>2012-04-19 13:48:43 +0300
committerYonit Halperin <yhalperi@redhat.com>2012-05-03 13:09:52 +0300
commit3373cda43476d24022bff769f4b7991eb61520cb (patch)
tree963f9334049f33e13ad69f120145848d59ac1c7c
parent8778b8eb2c026dcbeef96e28ca64c29b4f0f8888 (diff)
downloadspice-3373cda43476d24022bff769f4b7991eb61520cb.tar.gz
spice-3373cda43476d24022bff769f4b7991eb61520cb.tar.xz
spice-3373cda43476d24022bff769f4b7991eb61520cb.zip
server/tests/test_display_streaming: update to create sized frames
-rw-r--r--server/tests/test_display_streaming.c44
1 files changed, 37 insertions, 7 deletions
diff --git a/server/tests/test_display_streaming.c b/server/tests/test_display_streaming.c
index 1b81d766..b4fe0136 100644
--- a/server/tests/test_display_streaming.c
+++ b/server/tests/test_display_streaming.c
@@ -5,14 +5,37 @@
*/
#include <config.h>
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+#include <unistd.h>
#include "test_display_base.h"
-int simple_commands[] = {
- SIMPLE_DRAW,
- SIMPLE_UPDATE,
- PATH_PROGRESS,
- SIMPLE_CREATE_SURFACE,
- SIMPLE_DESTROY_SURFACE,
+static int sized;
+
+void create_update(Command *command)
+{
+ static int count = 0;
+ CommandDrawSolid *cmd = &command->solid;
+ cmd->surface_id = 0;
+
+ cmd->bbox.left = 0;
+ cmd->bbox.right = test_get_width();
+ cmd->bbox.top = 0;
+ cmd->color = 0xffff00 + ((count * 10) % 256);
+ assert(test_get_height() > 50);
+ cmd->bbox.bottom = test_get_height() - 50;
+ if (count < 20) {
+ } else if (sized && count % 5 == 0) {
+ cmd->bbox.bottom = test_get_height();
+ cmd->color = 0xff;
+ }
+ count++;
+ printf("%d %d\n", count, cmd->bbox.bottom);
+}
+
+static Command commands[] = {
+ {SIMPLE_DRAW_SOLID, create_update},
};
SpiceCoreInterface *core;
@@ -20,12 +43,19 @@ SpiceServer *server;
int main(int argc, char **argv)
{
+ int i;
spice_test_config_parse_args(argc, argv);
+ sized = 0;
+ for (i = 1 ; i < argc; ++i) {
+ if (strcmp(argv[i], "sized") == 0) {
+ sized = 1;
+ }
+ }
core = basic_event_loop_init();
server = test_init(core);
spice_server_set_streaming_video(server, SPICE_STREAM_VIDEO_ALL);
test_add_display_interface(server);
- test_set_simple_command_list(simple_commands, COUNT(simple_commands));
+ test_set_command_list(commands, COUNT(commands));
basic_event_loop_mainloop();
return 0;
}