src/ds++/test/tstXGetopt.cc
//------------------------------------------------------------------------------------------------//
// Test 18: shorotps, missing argument
Test 18: shorotps, missing argument
Test 18 : shorotps missing argument
void tst_lopts_args_missingarg(rtt_dsxx::UnitTest &ut) {
  std::cout << "\n>>> Begin test 18..." << std::endl;
  std::array<char const *, 2> my_argv = {"tstXGetopt", "--create"};
  try {
    rtt_dsxx::XGetopt::csmap long_options = {{'c', "create:"}, {'h', "help"}, {'v', "version"}};
    rtt_dsxx::XGetopt program_options(static_cast<int>(my_argv.size()), my_argv.data(),
                                      long_options);
    FAILMSG("Insist failed to fire with missing required argument.");
  } catch (rtt_dsxx::assertion & ) {
    PASSMSG("As expected, Insist fired with missing required argument.");
  }
  return;
}
void tst_lopts_args_missingarg ( rtt_dsxx :: UnitTest & ut ) { std :: cout << " \n " << std :: endl ; std :: array < char const * , 2 > my_argv = { " " , " " } ; try { rtt_dsxx :: XGetopt :: csmap long_options = { { ' ' , " " } , { ' ' , " " } , { ' ' , " " } } ; rtt_dsxx :: XGetopt program_options ( static_cast < int > ( my_argv . size ( ) ) , my_argv . data ( ) , long_options ) ; FAILMSG ( " " ) ; } catch ( rtt_dsxx :: assertion & ) { PASSMSG ( " " ) ; } return ; }
Test 18: shorotps, missing argument
Test 18 : shorotps missing argument
// Simulate argc and argv for no arguments case. // Register options /*error*/