Skip to content

Commit

Permalink
test error handling of erroneous calls of initialize and finalize
Browse files Browse the repository at this point in the history
  • Loading branch information
benegee committed Aug 29, 2023
1 parent 0bd06d0 commit b55939f
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/c/interface_c.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,28 @@ TEST(CInterfaceTest, JuliaProject) {
"this_string_is_just_way_toooooooooooooooooooo_long";
EXPECT_DEATH( trixi_initialize( garbage, "/tmp" ),
"buffer size not sufficient for activation command");

// do not finalize before initialization
EXPECT_DEATH( trixi_finalize(),
"trixi_initialize must be called before trixi_finalize");

// Initialize libtrixi
trixi_initialize( julia_project_path, NULL );

// do not initialize twice
EXPECT_DEATH( trixi_initialize( julia_project_path, NULL ),
"trixi_initialize invoked multiple times");

// Finalize libtrixi
trixi_finalize();

// do not finalize twice
EXPECT_DEATH( trixi_finalize(),
"trixi_finalize invoked multiple times");

// do not initialize after finalization
EXPECT_DEATH( trixi_initialize( julia_project_path, NULL ),
"trixi_initialize invoked multiple times");
}


Expand Down

0 comments on commit b55939f

Please sign in to comment.