@@ -41,7 +41,7 @@ int main(int argc, char* argv[])
4141 std::vector<std::string> sa;
4242 std::vector<std::string> sb;
4343 pp.getarr (" sa" , sa);
44- pp.getarr (" sa " , sb);
44+ pp.getarr (" sb " , sb);
4545 AMREX_ALWAYS_ASSERT (sa == sb && (sa == std::vector<std::string>{" abc" ," xyz" ," 123" }));
4646
4747 IntVect iv;
@@ -325,25 +325,28 @@ int main(int argc, char* argv[])
325325 AMREX_ALWAYS_ASSERT (s == sv[i]);
326326 }
327327 }
328- if (ParallelDescriptor::IOProcessor ()) // print & addfile
328+
329+ // print & addfile
329330 {
330- {
331- ParmParse pp ;
332- pp.add (" string-for-testing-addfile" , " string for testing addfile" );
333- pp.add (" string-for-testing-addfile " , " string for testing addfile" );
334- int n = pp. countname ( " string-for-testing-addfile " );
335- AMREX_ALWAYS_ASSERT (n== 2 );
336- }
331+ ParmParse pp;
332+ pp. add ( " string-for-testing-addfile " , " string for testing addfile " ) ;
333+ pp.add (" string-for-testing-addfile" , " string for testing addfile" );
334+ int n = pp.countname (" string-for-testing-addfile" );
335+ AMREX_ALWAYS_ASSERT (n== 2 );
336+ }
337+ if ( ParallelDescriptor::IOProcessor ()) {
337338 std::ofstream ofs (" my-inputs" );
338339 ParmParse::prettyPrintTable (ofs);
339- ofs.close ();
340+ }
341+ {
340342 ParmParse::addfile (" my-inputs" );
341343 std::string s;
342344 ParmParse pp;
343345 pp.get (" string-for-testing-addfile" , s);
344346 int n = pp.countname (" string-for-testing-addfile" );
345347 AMREX_ALWAYS_ASSERT (n==3 && s == " string for testing addfile" );
346348 }
349+
347350 { // UNSET directive
348351 ParmParse pp;
349352 // "unset_me" is defined then immediately unset in the inputs file
0 commit comments