unit_tests/utilities/test_refinement.cpp
/*  Check that the implementation emits a warning when the levels requested in
 *  the input file does not match the levels in static refinement file
 */
Check that the implementation emits a warning when the levels requested in
the input file does not match the levels in static refinement file
Check that the implementation emits a warning when the levels requested in the input file does not match the levels in static refinement file
TEST_F(NestRefineTest, level_warning)
{
    setup_refinement_inputs();
    {
        amrex::ParmParse pp("amr");
        pp.add("max_level", 0);
    }
    std::stringstream ss;
    ss << "2 // Number of levels" << std::endl;
    ss << "2 // Number of boxes at this level" << std::endl;
    ss << "-10.0 -75.0 0.0 15.0 -65.0 20.0" << std::endl;
    ss << "-10.0 -55.0 0.0 15.0 -45.0 20.0" << std::endl;
    ss << "2 // Number of boxes at this level" << std::endl;
    ss << "-10.0  25.0 0.0 15.0  35.0 20.0" << std::endl;
    ss << "-10.0  65.0 0.0 15.0  75.0 20.0" << std::endl;
    {
        CaptureOutput io;
        create_mesh_instance<NestRefineMesh>();
        std::unique_ptr<amr_wind::CartBoxRefinement> box_refine(
            new amr_wind::CartBoxRefinement(sim()));
        box_refine->read_inputs(mesh(), ss);
        auto msg = io.stdout().str();
        EXPECT_GT(msg.size(), 0);
        auto found = msg.find("WARNING");
        EXPECT_NE(found, std::string::npos);
    }
}
TEST_F ( NestRefineTest , level_warning ) { setup_refinement_inputs ( ) ; { amrex :: ParmParse pp ( " " ) ; pp . add ( " " , 0 ) ; } std :: stringstream ss ; ss << " " << std :: endl ; ss << " " << std :: endl ; ss << " " << std :: endl ; ss << " " << std :: endl ; ss << " " << std :: endl ; ss << " " << std :: endl ; ss << " " << std :: endl ; { CaptureOutput io ; create_mesh_instance < NestRefineMesh > ( ) ; std :: unique_ptr < amr_wind :: CartBoxRefinement > box_refine ( new amr_wind :: CartBoxRefinement ( sim ( ) ) ) ; box_refine -> read_inputs ( mesh ( ) , ss ) ; auto msg = io . stdout ( ) . str ( ) ; EXPECT_GT ( msg . size ( ) , 0 ) ; auto found = msg . find ( " " ) ; EXPECT_NE ( found , std :: string :: npos ) ; } }
Check that the implementation emits a warning when the levels requested in
  the input file does not match the levels in static refinement file
Check that the implementation emits a warning when the levels requested in the input file does not match the levels in static refinement file
// Create the "input file"