-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace jobs array with job_queue_node_type vector
* Replace **jobs array with std::vector<job_queue_node_type *> * Move initialization to struct and replace NULL with nullptr * Inline job_list_reset and remove job_list_get_size * Initialize struct contents brace style
- Loading branch information
1 parent
6e7d720
commit bfbd5f3
Showing
6 changed files
with
37 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,22 @@ | ||
#include <cassert> | ||
#include <stdlib.h> | ||
|
||
#include <ert/job_queue/job_node.hpp> | ||
#include <ert/util/test_util.hpp> | ||
|
||
void test_create() { | ||
job_queue_node_type *node = job_queue_node_alloc( | ||
"name", "/tmp", "ls", 0, stringlist_alloc_new(), 1, NULL, NULL); | ||
job_queue_node_free(node); | ||
} | ||
|
||
void call_get_queue_index(void *arg) { | ||
auto node = static_cast<job_queue_node_type *>(arg); | ||
job_queue_node_get_queue_index(node); | ||
} | ||
|
||
void test_queue_index() { | ||
job_queue_node_type *node = job_queue_node_alloc( | ||
"name", "/tmp", "ls", 0, stringlist_alloc_new(), 1, NULL, NULL); | ||
test_assert_util_abort("job_queue_node_get_queue_index", | ||
call_get_queue_index, node); | ||
} | ||
|
||
void test_path_does_not_exist() { | ||
job_queue_node_type *node = | ||
job_queue_node_alloc("name", "does-not-exist", "ls", 0, | ||
stringlist_alloc_new(), 1, NULL, NULL); | ||
test_assert_NULL(node); | ||
assert(node == nullptr); | ||
} | ||
|
||
int main(int argc, char **argv) { | ||
util_install_signals(); | ||
test_create(); | ||
test_queue_index(); | ||
test_path_does_not_exist(); | ||
} |