Skip to content

Commit

Permalink
test/core/batch: Add a test for empty batches
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelkuhn committed Mar 16, 2021
1 parent 28e58c3 commit 3051d7d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/core/batch.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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);
}

0 comments on commit 3051d7d

Please sign in to comment.