From 3051d7df60757022e99fffdd8fc621e7b4c22a15 Mon Sep 17 00:00:00 2001
From: Michael Kuhn <michael.kuhn@ovgu.de>
Date: Tue, 16 Mar 2021 12:53:38 +0100
Subject: [PATCH] test/core/batch: Add a test for empty batches

---
 test/core/batch.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/test/core/batch.c b/test/core/batch.c
index afa2c6509..bd41791ea 100644
--- a/test/core/batch.c
+++ b/test/core/batch.c
@@ -66,6 +66,19 @@ test_batch_semantics(void)
 	j_batch_unref(batch);
 }
 
+static void
+test_batch_execute_empty(void)
+{
+	g_autoptr(JBatch) batch = NULL;
+	gboolean ret;
+
+	batch = j_batch_new_for_template(J_SEMANTICS_TEMPLATE_DEFAULT);
+	g_assert_true(batch != NULL);
+
+	ret = j_batch_execute(batch);
+	g_assert_false(ret);
+}
+
 static void
 _test_batch_execute(gboolean async)
 {
@@ -120,6 +133,7 @@ test_core_batch(void)
 {
 	g_test_add_func("/core/batch/new_free", test_batch_new_free);
 	g_test_add_func("/core/batch/semantics", test_batch_semantics);
+	g_test_add_func("/core/batch/execute_empty", test_batch_execute_empty);
 	g_test_add_func("/core/batch/execute", test_batch_execute);
 	g_test_add_func("/core/batch/execute_async", test_batch_execute_async);
 }