Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lucacarniato committed Aug 21, 2023
1 parent 9e49a54 commit 4c5128f
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions libs/MeshKernelApi/tests/src/ApiTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1312,9 +1312,8 @@ TEST(ApiStatelessTests, Orthogonalize_OnInvaliMesh_ShouldThrowAMeshGeometryError
ASSERT_EQ(meshkernelapi::MeshKernelApiErrors::Success, errorCode);

// Get the message
auto exceptionMessage = std::string(" ", 512);
auto exceptionMessagePtr = const_cast<char*>(exceptionMessage.c_str());
errorCode = meshkernelapi::mkernel_get_error(exceptionMessagePtr);
auto exceptionMessage = std::make_unique<char[]>(512);
errorCode = meshkernelapi::mkernel_get_error(exceptionMessage.get());
ASSERT_EQ(meshkernelapi::MeshKernelApiErrors::Success, errorCode);

// Get the index of the invalid location
Expand All @@ -1327,10 +1326,9 @@ TEST(ApiStatelessTests, Orthogonalize_OnInvaliMesh_ShouldThrowAMeshGeometryError

TEST(ApiStatelessTests, TestGettingVersionThroughApi)
{
auto versionFromApi = std::string(" ", 64);
auto versionFromApiPtr = const_cast<char*>(versionFromApi.c_str());
meshkernelapi::mkernel_get_version(versionFromApiPtr);
ASSERT_EQ(versionString, versionFromApi);
auto versionFromApi = std::make_unique<char[]>(64);
meshkernelapi::mkernel_get_version(versionFromApi.get());
ASSERT_EQ(strcmp(versionFromApi.get(), versionString), 0);
}

TEST_F(CartesianApiTests, CurvilinearComputeTransfiniteFromPolygon_ShouldComputeAValidCurvilinearGrid)
Expand Down

0 comments on commit 4c5128f

Please sign in to comment.