Skip to content

Commit

Permalink
Try using lambdas
Browse files Browse the repository at this point in the history
  • Loading branch information
andreas-el committed Sep 11, 2023
1 parent 0676884 commit 0f4b8ff
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions src/clib/old_tests/job_queue/test_job_queue_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,6 @@ void set_option_valid_on_specific_driver_returns_true() {
queue_driver_free(driver_torque);
}

void call_get_option(void *arg) {
auto local_driver = reinterpret_cast<queue_driver_type>(arg);
queue_driver_get_option(local_driver, "Not implemented");
}

void call_set_option(void *arg) {
auto local_driver = reinterpret_cast<queue_driver_type>(arg);
queue_driver_set_option(local_driver, "Not implemented");
}

void get_driver_option_lists() {
//Torque driver option list
{
Expand All @@ -74,10 +64,21 @@ void get_driver_option_lists() {
stringlist_type *option_list = stringlist_alloc_new();
queue_driver_init_option_list(driver_local, option_list);

test_assert_util_abort("local_driver_get_option", call_get_option,
driver_local);
test_assert_util_abort("local_driver_set_option", call_set_option,
driver_local);
test_assert_util_abort(
"local_driver_get_option",
[](void *arg) {
auto local_driver = static_cast<queue_driver_type *>(arg);
queue_driver_get_option(local_driver, "Not implemented");
},
driver_local);

test_assert_util_abort(
"local_driver_set_option",
[](void *arg) {
auto local_driver = static_cast<queue_driver_type *>(arg);
queue_driver_set_option(local_driver, "Not implemented");
},
driver_local);

stringlist_free(option_list);
queue_driver_free(driver_local);
Expand Down

0 comments on commit 0f4b8ff

Please sign in to comment.