InputParameters validParams<MultiAppTransfer>() { InputParameters params = validParams<Transfer>(); params.addRequiredParam<MultiAppName>("multi_app", "The name of the MultiApp to use."); params.addRequiredParam<MooseEnum>("direction", MultiAppTransfer::directions(), "Whether this Transfer will be 'to' or 'from' a MultiApp."); // MultiAppTransfers by default will execute with their associated MultiApp. These flags will be // added by FEProblemBase when the transfer is added. ExecFlagEnum & exec_enum = params.set<ExecFlagEnum>("execute_on", true); exec_enum.addAvailableFlags(EXEC_SAME_AS_MULTIAPP); exec_enum = EXEC_SAME_AS_MULTIAPP; params.setDocString("execute_on", exec_enum.getDocString()); params.addParam<bool>( "check_multiapp_execute_on", true, "When false the check between the multiapp and transfer execute on flags is not preformed."); params.addParam<bool>("displaced_source_mesh", false, "Whether or not to use the displaced mesh for the source mesh."); params.addParam<bool>("displaced_target_mesh", false, "Whether or not to use the displaced mesh for the target mesh."); return params; }
TEST(InputParameters, checkSetDocString) { InputParameters params = emptyInputParameters(); params.addParam<Real>("little_guy", "What about that little guy?"); params.setDocString("little_guy", "That little guy, I wouldn't worry about that little_guy."); ASSERT_TRUE(params.getDocString("little_guy") .find("That little guy, I wouldn't worry about that little_guy.") != std::string::npos) << "retrieved doc string has unexpected value '" << params.getDocString("little_guy") << "'"; }
TEST(InputParameters, checkSetDocStringError) { try { InputParameters params = emptyInputParameters(); params.setDocString("little_guy", "That little guy, I wouldn't worry about that little_guy."); FAIL() << "failed to error on attempt to set non-existing parameter"; } catch (const std::exception & e) { std::string msg(e.what()); ASSERT_TRUE(msg.find("Unable to set the documentation string (using setDocString)") != std::string::npos) << "failed with unexpected error: " << msg; } }