From fbbef1e7240dba046eda5ef0bf8e236ce8ed1bc6 Mon Sep 17 00:00:00 2001 From: Travis Reitter Date: Mon, 28 Dec 2009 17:16:09 -0800 Subject: Add tests to stress-test the addressbook factory. --- .../tests/ebook/test-ebook-stress-factory--fifo.c | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 addressbook/tests/ebook/test-ebook-stress-factory--fifo.c (limited to 'addressbook/tests/ebook/test-ebook-stress-factory--fifo.c') diff --git a/addressbook/tests/ebook/test-ebook-stress-factory--fifo.c b/addressbook/tests/ebook/test-ebook-stress-factory--fifo.c new file mode 100644 index 000000000..cf8e03e47 --- /dev/null +++ b/addressbook/tests/ebook/test-ebook-stress-factory--fifo.c @@ -0,0 +1,33 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ + +#include +#include + +#include "ebook-test-utils.h" + +#define NUM_BOOKS 200 + +gint +main (gint argc, gchar **argv) +{ + char *uri = NULL; + EBook *books[NUM_BOOKS]; + gint i; + + g_type_init (); + + /* Create and open many books; then remove each of them */ + + for (i = 0; i < NUM_BOOKS; i++) { + books[i] = ebook_test_utils_book_new_temp (&uri); + ebook_test_utils_book_open (books[i], FALSE); + + g_free (uri); + } + + for (i = 0; i < NUM_BOOKS; i++) { + ebook_test_utils_book_remove (books[i]); + } + + return 0; +} -- cgit v1.2.1