Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unit test all supported functor name type retrieval
- Loading branch information
Showing
3 changed files
with
79 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
//* This file is part of the MOOSE framework | ||
//* https://www.mooseframework.org | ||
//* | ||
//* All rights reserved, see COPYRIGHT for full restrictions | ||
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT | ||
//* | ||
//* Licensed under LGPL 2.1, please see LICENSE for details | ||
//* https://www.gnu.org/licenses/lgpl-2.1.html | ||
|
||
#include "gtest/gtest.h" | ||
#include "FunctorInterface.h" | ||
#include "InputParameters.h" | ||
#include "MooseTypes.h" | ||
|
||
TEST(FunctorInterfaceTest, deduceFunctorName) | ||
{ | ||
const auto base_params = emptyInputParameters(); | ||
{ | ||
auto params = base_params; | ||
params.set<MooseFunctorName>("test") = "functor"; | ||
EXPECT_EQ(FunctorInterface::deduceFunctorName("test", params), "functor"); | ||
} | ||
{ | ||
auto params = base_params; | ||
params.set<MaterialPropertyName>("test") = "prop"; | ||
EXPECT_EQ(FunctorInterface::deduceFunctorName("test", params), "prop"); | ||
} | ||
{ | ||
auto params = base_params; | ||
params.set<VariableName>("test") = "var"; | ||
EXPECT_EQ(FunctorInterface::deduceFunctorName("test", params), "var"); | ||
} | ||
{ | ||
auto params = base_params; | ||
params.set<std::vector<VariableName>>("test") = {"vector_var"}; | ||
EXPECT_EQ(FunctorInterface::deduceFunctorName("test", params), "vector_var"); | ||
} | ||
{ | ||
auto params = base_params; | ||
params.set<NonlinearVariableName>("test") = "nl_var"; | ||
EXPECT_EQ(FunctorInterface::deduceFunctorName("test", params), "nl_var"); | ||
} | ||
{ | ||
auto params = base_params; | ||
params.set<FunctionName>("test") = "function"; | ||
EXPECT_EQ(FunctorInterface::deduceFunctorName("test", params), "function"); | ||
} | ||
{ | ||
auto params = base_params; | ||
EXPECT_EQ(FunctorInterface::deduceFunctorName("test", params), "test"); | ||
} | ||
} |