feat(cpp-object-oriented-modular-refactoring): step 3 - foundation-google-style
This commit is contained in:
@@ -20,12 +20,12 @@ fesa::DofManager makeEmptyDofs() {
|
||||
{definition.sourcePath, 10U}}};
|
||||
|
||||
auto domain = fesa::Domain::create(std::move(definition));
|
||||
EXPECT_TRUE(domain.hasValue());
|
||||
auto model = fesa::AnalysisModel::create(domain.value());
|
||||
EXPECT_TRUE(model.hasValue());
|
||||
auto dofs = fesa::DofManager::create(model.value());
|
||||
EXPECT_TRUE(dofs.hasValue());
|
||||
return std::move(dofs.value());
|
||||
EXPECT_TRUE(domain.HasValue());
|
||||
auto model = fesa::AnalysisModel::create(domain.Value());
|
||||
EXPECT_TRUE(model.HasValue());
|
||||
auto dofs = fesa::DofManager::create(model.Value());
|
||||
EXPECT_TRUE(dofs.HasValue());
|
||||
return std::move(dofs.Value());
|
||||
}
|
||||
|
||||
fesa::ShellResultRow makeShellRow(
|
||||
@@ -141,15 +141,15 @@ void expectShellCandidateRejectedWithoutMutation(
|
||||
const fesa::ShellStateCandidate& candidate,
|
||||
const fesa::ShellStateCandidate& committed) {
|
||||
const auto status = state.commitShellResults(expectedElements, candidate);
|
||||
EXPECT_FALSE(status.isOk());
|
||||
EXPECT_EQ(status.failureCategory(), fesa::FailureCategory::model);
|
||||
EXPECT_FALSE(status.IsOk());
|
||||
EXPECT_EQ(status.Category(), fesa::FailureCategory::kModel);
|
||||
expectShellStateEquals(
|
||||
state,
|
||||
committed.rows,
|
||||
committed.physicalStrainEnergy,
|
||||
committed.equilibrium,
|
||||
committed.verificationMetrics);
|
||||
ASSERT_TRUE(state.commitShellResults(expectedElements, committed).isOk());
|
||||
ASSERT_TRUE(state.commitShellResults(expectedElements, committed).IsOk());
|
||||
}
|
||||
|
||||
} // namespace
|
||||
@@ -197,9 +197,9 @@ TEST(AnalysisState, PreservesStepFrameAndStableRowOrder) {
|
||||
EXPECT_EQ(constState.endpointResults().data(), endpointStorage);
|
||||
EXPECT_EQ(constState.endpointResults()[0].element, 2U);
|
||||
EXPECT_EQ(constState.endpointResults()[0].endpoint, -1);
|
||||
EXPECT_EQ(constState.endpointResults()[0].node.instanceName, "Beam-1");
|
||||
EXPECT_EQ(constState.endpointResults()[0].node.sourceLabel, 10);
|
||||
EXPECT_EQ(constState.endpointResults()[0].node.sourceLabelText, "010");
|
||||
EXPECT_EQ(constState.endpointResults()[0].node.instance_name, "Beam-1");
|
||||
EXPECT_EQ(constState.endpointResults()[0].node.source_label, 10);
|
||||
EXPECT_EQ(constState.endpointResults()[0].node.source_label_text, "010");
|
||||
EXPECT_EQ(
|
||||
constState.endpointResults()[0].endAction,
|
||||
(std::array<double, 6>{1.0, 2.0, 3.0, 4.0, 5.0, 6.0}));
|
||||
@@ -237,7 +237,7 @@ TEST(AnalysisState, OwnsExactShellRowsInStableElementAndLocationOrder) {
|
||||
|
||||
const auto status = state.commitShellResults(expectedElements, candidate);
|
||||
|
||||
ASSERT_TRUE(status.isOk());
|
||||
ASSERT_TRUE(status.IsOk());
|
||||
const fesa::AnalysisState& constState = state;
|
||||
ASSERT_EQ(constState.shellResults().size(), 8U);
|
||||
EXPECT_EQ(constState.shellResults()[0].element, 3U);
|
||||
@@ -283,7 +283,7 @@ TEST(AnalysisState, CommitsFiniteShellGlobalEvidence) {
|
||||
|
||||
const auto status = state.commitShellResults(expectedElements, candidate);
|
||||
|
||||
ASSERT_TRUE(status.isOk());
|
||||
ASSERT_TRUE(status.IsOk());
|
||||
EXPECT_DOUBLE_EQ(state.physicalStrainEnergy(), 35.5);
|
||||
EXPECT_EQ(
|
||||
state.equilibrium(),
|
||||
@@ -299,7 +299,7 @@ TEST(AnalysisState, InvalidShellCandidatesLeavePriorStateUnchanged) {
|
||||
auto state = fesa::AnalysisState::create(dofs, {"Step-1", 0U});
|
||||
const std::vector<fesa::EntityIndex> expectedElements{5U};
|
||||
const auto committed = makeShellCandidate(expectedElements);
|
||||
ASSERT_TRUE(state.commitShellResults(expectedElements, committed).isOk());
|
||||
ASSERT_TRUE(state.commitShellResults(expectedElements, committed).IsOk());
|
||||
|
||||
auto invalidLocation = makeShellCandidate(expectedElements);
|
||||
invalidLocation.rows[0].location = fesa::ShellMidsurfaceLocation::gp2;
|
||||
|
||||
Reference in New Issue
Block a user