X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/011c27bc18cae21954b6e1c752222c71990ac283..01714c14fe425c2579f8232f1f6ec27f8de03a4f:/teshsuite/smpi/privatization/privatization.c diff --git a/teshsuite/smpi/privatization/privatization.c b/teshsuite/smpi/privatization/privatization.c index 07c2b8fa95..143b479ad9 100644 --- a/teshsuite/smpi/privatization/privatization.c +++ b/teshsuite/smpi/privatization/privatization.c @@ -5,12 +5,40 @@ static int myvalue = 0; - +static void test_opts(int* argc, char **argv[]){ + int found = 0; + static struct option long_options[] = { + {(char*)"long", no_argument, 0, 0 }, + {0, 0, 0, 0 } + }; + while (1) { + int ret = getopt_long_only(*argc, *argv, "s", long_options, NULL); + if(ret==-1) + break; + + switch (ret) { + case 0: + found++; + break; + case 's': + found ++; + break; + default: + printf("option %s", long_options[0].name); + break; + } + } + if (found!=2){ + printf("(smpi_)getopt_long_only failed ! \n"); + } +} int main(int argc, char **argv) { int me; MPI_Init(&argc, &argv); + /* test getopt_long function */ + test_opts(&argc, &argv); MPI_Comm_rank(MPI_COMM_WORLD, &me);