Skip to content

Commit

Permalink
GRIDEDIT-1336 Corrected clang formatting warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
BillSenior committed Oct 30, 2024
1 parent 16887b6 commit 82cfaf0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 18 deletions.
2 changes: 1 addition & 1 deletion libs/MeshKernelApi/src/MeshKernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2195,7 +2195,7 @@ namespace meshkernelapi

if (meshKernelState[meshKernelId].m_nodeInPolygonCache == nullptr)
{
throw meshkernel::MeshKernelError("Node in polygon data has not been cached, mkernel_mesh2d_count_nodes_in_polygons must be called before");
throw meshkernel::MeshKernelError("Node in polygon data has not been cached, mkernel_mesh2d_count_nodes_in_polygons must be called before");
}

auto const polygonVector = ConvertGeometryListToPointVector(geometryListIn);
Expand Down
32 changes: 15 additions & 17 deletions libs/MeshKernelApi/tests/src/ApiCacheTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,18 @@
int MakeUnstructuredMesh(int meshKernelId, meshkernel::UInt numRows = 2, meshkernel::UInt numColumns = 3, double delta = 1.0)
{

// Set-up new mesh
auto [num_nodes, num_edges, node_x, node_y, edge_nodes] = MakeRectangularMeshForApiTesting(numRows, numColumns, delta);
meshkernelapi::Mesh2D mesh2d{};
mesh2d.num_edges = static_cast<int>(num_edges);
mesh2d.num_nodes = static_cast<int>(num_nodes);
mesh2d.node_x = node_x.data();
mesh2d.node_y = node_y.data();
mesh2d.edge_nodes = edge_nodes.data();
int errorCode = meshkernelapi::mkernel_mesh2d_set(meshKernelId, mesh2d);

return errorCode;
}
// Set-up new mesh
auto [num_nodes, num_edges, node_x, node_y, edge_nodes] = MakeRectangularMeshForApiTesting(numRows, numColumns, delta);
meshkernelapi::Mesh2D mesh2d{};
mesh2d.num_edges = static_cast<int>(num_edges);
mesh2d.num_nodes = static_cast<int>(num_nodes);
mesh2d.node_x = node_x.data();
mesh2d.node_y = node_y.data();
mesh2d.edge_nodes = edge_nodes.data();
int errorCode = meshkernelapi::mkernel_mesh2d_set(meshKernelId, mesh2d);

return errorCode;
}

TEST(ApiCacheTest, GetHangingEdgesMesh2D_WithOneHangingEdges_GetOneHangingEdgesFailures)
{
Expand Down Expand Up @@ -71,7 +70,7 @@ TEST(ApiCacheTest, GetHangingEdgesMesh2D_WithOneHangingEdges_GetOneHangingEdgesF
errorCode = meshkernelapi::mkernel_mesh2d_get_hanging_edges(meshKernelId, hangingEdges.data());
ASSERT_EQ(meshkernel::ExitCode::MeshKernelErrorCode, errorCode);

errorCode = meshkernelapi::mkernel_expunge_state (meshKernelId);
errorCode = meshkernelapi::mkernel_expunge_state(meshKernelId);
ASSERT_EQ(meshkernel::ExitCode::Success, errorCode);
}

Expand Down Expand Up @@ -125,7 +124,7 @@ TEST(ApiCacheTest, GetNodesInPolygonMesh2D_OnMesh2D_NodeInPolygonFailures)
errorCode = mkernel_mesh2d_get_nodes_in_polygons(meshKernelId, geometryListIn, 1, nullArray);
ASSERT_EQ(meshkernel::ExitCode::MeshKernelErrorCode, errorCode);

errorCode = meshkernelapi::mkernel_expunge_state (meshKernelId);
errorCode = meshkernelapi::mkernel_expunge_state(meshKernelId);
ASSERT_EQ(meshkernel::ExitCode::Success, errorCode);
}

Expand Down Expand Up @@ -192,11 +191,10 @@ TEST(ApiCacheTest, GetSmallFlowEdges_OnMesh2D_GetSmallFlowEdgesFailures)
errorCode = meshkernelapi::mkernel_mesh2d_count_small_flow_edge_centers(meshKernelId, smallFlowEdgesThreshold, numSmallFlowEdges);
ASSERT_EQ(meshkernel::ExitCode::ConstraintErrorCode, errorCode);

errorCode = meshkernelapi::mkernel_expunge_state (meshKernelId);
errorCode = meshkernelapi::mkernel_expunge_state(meshKernelId);
ASSERT_EQ(meshkernel::ExitCode::Success, errorCode);
}


TEST(ApiCacheTest, CountObtuseTriangles_OnMesh2DWithOneObtuseTriangle_ObtuseTrianglesFailures)
{
// Prepare a mesh with one obtuse triangle
Expand Down Expand Up @@ -250,6 +248,6 @@ TEST(ApiCacheTest, CountObtuseTriangles_OnMesh2DWithOneObtuseTriangle_ObtuseTria
errorCode = mkernel_mesh2d_get_obtuse_triangles_mass_centers(meshKernelId, geometryList);
ASSERT_EQ(meshkernel::ExitCode::MeshKernelErrorCode, errorCode);

errorCode = meshkernelapi::mkernel_expunge_state (meshKernelId);
errorCode = meshkernelapi::mkernel_expunge_state(meshKernelId);
ASSERT_EQ(meshkernel::ExitCode::Success, errorCode);
}

0 comments on commit 82cfaf0

Please sign in to comment.