summaryrefslogtreecommitdiff
path: root/addressbook/tests/ebook/test-ebook-stress-factory--single-book.c
diff options
context:
space:
mode:
Diffstat (limited to 'addressbook/tests/ebook/test-ebook-stress-factory--single-book.c')
-rw-r--r--addressbook/tests/ebook/test-ebook-stress-factory--single-book.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/addressbook/tests/ebook/test-ebook-stress-factory--single-book.c b/addressbook/tests/ebook/test-ebook-stress-factory--single-book.c
new file mode 100644
index 000000000..9e3e9be30
--- /dev/null
+++ b/addressbook/tests/ebook/test-ebook-stress-factory--single-book.c
@@ -0,0 +1,35 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
+#include <stdlib.h>
+#include <libebook/e-book.h>
+
+#include "ebook-test-utils.h"
+
+#define NUM_OPENS 200
+
+gint
+main (gint argc, gchar **argv)
+{
+ char *uri = NULL;
+ EBook *book;
+ gint i;
+
+ g_type_init ();
+
+ book = ebook_test_utils_book_new_temp (&uri);
+ g_object_unref (book);
+
+ /* open and close the same book repeatedly */
+ for (i = 0; i < NUM_OPENS-1; i++) {
+ book = ebook_test_utils_book_new_from_uri (uri);
+ ebook_test_utils_book_open (book, FALSE);
+ g_object_unref (book);
+ }
+
+ book = ebook_test_utils_book_new_from_uri (uri);
+ ebook_test_utils_book_remove (book);
+
+ g_free (uri);
+
+ return 0;
+}