Skip to content

Commit

Permalink
eCAL::Finalize() fixed (no more parameter)
Browse files Browse the repository at this point in the history
  • Loading branch information
rex-schilasky committed May 15, 2024
1 parent d78c4d3 commit d0d034e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
4 changes: 1 addition & 3 deletions ecal/core/include/ecal/cimpl/ecal_core_cimpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,9 @@ extern "C"
/**
* @brief Finalize eCAL API.
*
* @param components_ Defines which component to initialize (not yet supported).
*
* @return Zero if succeeded, 1 if already finalized, -1 if failed.
**/
ECALC_API int eCAL_Finalize(unsigned int components_);
ECALC_API int eCAL_Finalize();

/**
* @brief Check eCAL initialize state.
Expand Down
4 changes: 2 additions & 2 deletions ecal/core/src/cimpl/ecal_core_cimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ extern "C"
return(eCAL::SetUnitName(unit_name_));
}

ECALC_API int eCAL_Finalize(unsigned int components_)
ECALC_API int eCAL_Finalize()
{
return(eCAL::Finalize(components_));
return(eCAL::Finalize());
}

ECALC_API int eCAL_IsInitialized(unsigned int component_)
Expand Down
12 changes: 6 additions & 6 deletions ecal/tests/c/core_test/src/core_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,19 @@ TEST(core_c_core, InitializeFinalize)
EXPECT_EQ(1, eCAL_Initialize(0, nullptr, "initialize_test", 0));

// finalize eCAL API we expect return value 0 even it will not be really finalized because it's 2 times initialzed and 1 time finalized
EXPECT_EQ(0, eCAL_Finalize(0));
EXPECT_EQ(0, eCAL_Finalize());

// Is eCAL API initialized ? yes it' still initialized
EXPECT_EQ(1, eCAL_IsInitialized(0));

// finalize eCAL API we expect return value 0 because now it will be finalized
EXPECT_EQ(0, eCAL_Finalize(0));
EXPECT_EQ(0, eCAL_Finalize());

// Is eCAL API initialized ? no
EXPECT_EQ(0, eCAL_IsInitialized(0));

// finalize eCAL API we expect return value 1 because it was finalized before
EXPECT_EQ(1, eCAL_Finalize(0));
EXPECT_EQ(1, eCAL_Finalize());
}

TEST(core_c_core, MultipleInitializeFinalize)
Expand All @@ -82,7 +82,7 @@ TEST(core_c_core, MultipleInitializeFinalize)
EXPECT_EQ(0, eCAL_Initialize(0, nullptr, "multiple_initialize_finalize_test", 0));

// finalize eCAL API
EXPECT_EQ(0, eCAL_Finalize(0));
EXPECT_EQ(0, eCAL_Finalize());
}
}

Expand Down Expand Up @@ -148,7 +148,7 @@ TEST(core_c_core, SetGetUnitName)
EXPECT_STREQ("unit name", unit_name);

// finalize eCAL API we expect return value 0 because it will be finalized
EXPECT_EQ(0, eCAL_Finalize(0));
EXPECT_EQ(0, eCAL_Finalize());
}

TEST(core_c_core, eCAL_Ok)
Expand All @@ -163,7 +163,7 @@ TEST(core_c_core, eCAL_Ok)
EXPECT_EQ(1, eCAL_Ok());

// finalize eCAL API we expect return value 0 because it will be finalized
EXPECT_EQ(0, eCAL_Finalize(0));
EXPECT_EQ(0, eCAL_Finalize());

// check finalized eCAL, should not be okay
EXPECT_EQ(0, eCAL_Ok());
Expand Down

0 comments on commit d0d034e

Please sign in to comment.