Ignore:
Timestamp:
Feb 26, 2024, 3:53:42 AM (19 months ago)
Author:
JiadaL <j82liang@…>
Branches:
master
Children:
3f9a8d0
Parents:
0522ebe (diff), 022bce0 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Resolve conflict

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/configs/usage.cfa

    r0522ebe ra4da45e  
    1010// Author           : Thierry Delisle
    1111// Created On       : Wed Oct 12 15:28:01 2022
    12 // Last Modified By :
    13 // Last Modified On :
    14 // Update Count     :
     12// Last Modified By : Peter A. Buhr
     13// Last Modified On : Sun Feb 11 09:29:51 2024
     14// Update Count     : 1
    1515//
    1616
     
    2424
    2525        sout | "No args, no errors";
    26         if(pid_t child = strict_fork(); child == 0) {
     26        if ( pid_t child = strict_fork(); child == 0 ) {
    2727                array( cfa_option, 0 ) opts;
    28                 print_args_usage(1, fake_argv, opts, "Test usage", false);
    29         }
    30         else {
    31                 int status = do_wait(child);
    32                 print_status(status);
    33         }
     28                print_args_usage(1, fake_argv, opts, "Test usage", false );
     29        } else {
     30                int status = do_wait( child );
     31                print_status( status );
     32        } // if
    3433
    3534        sout | "No args, with errors";
    36         if(pid_t child = strict_fork(); child == 0) {
     35        if ( pid_t child = strict_fork(); child == 0 ) {
    3736                array( cfa_option, 0 ) opts;
    38                 print_args_usage(1, fake_argv, opts, "Test usage", true);
    39         }
    40         else {
    41                 int status = do_wait(child);
    42                 print_status(status);
    43         }
     37                print_args_usage(1, fake_argv, opts, "Test usage", true );
     38        } else {
     39                int status = do_wait( child );
     40                print_status( status );
     41        } // if
    4442
    4543        sout | "Args with short names only:";
    46         if(pid_t child = strict_fork(); child == 0) {
     44        if ( pid_t child = strict_fork(); child == 0 ) {
    4745                int a, b, c;
    4846                array( cfa_option, 3 ) opts;
     
    5048                opts[1] = (cfa_option){'b', "", "Second arg", b };
    5149                opts[2] = (cfa_option){'c', "", "Third arg", c };
    52                 print_args_usage(1, fake_argv, opts, "Test usage", false);
    53         }
    54         else {
    55                 int status = do_wait(child);
    56                 print_status(status);
    57         }
     50                print_args_usage(1, fake_argv, opts, "Test usage", false );
     51        } else {
     52                int status = do_wait( child );
     53                print_status( status );
     54        } // if
    5855
    5956        sout | "Args with long names only:";
    60         if(pid_t child = strict_fork(); child == 0) {
     57        if ( pid_t child = strict_fork(); child == 0 ) {
    6158                int a, b, c;
    6259                array( cfa_option, 3 ) opts;
     
    6461                opts[1] = (cfa_option){'\0', "BB", "Second arg", b };
    6562                opts[2] = (cfa_option){'\0', "CC", "Third arg", c };
    66                 print_args_usage(1, fake_argv, opts, "Test usage", false);
    67         }
    68         else {
    69                 int status = do_wait(child);
    70                 print_status(status);
    71         }
     63                print_args_usage(1, fake_argv, opts, "Test usage", false );
     64        } else {
     65                int status = do_wait( child );
     66                print_status( status );
     67        } // if
    7268
    7369        sout | "Mix of short and long args:";
    74         if(pid_t child = strict_fork(); child == 0) {
     70        if ( pid_t child = strict_fork(); child == 0 ) {
    7571                int a, b, c;
    7672                array( cfa_option, 3 ) opts;
     
    7874                opts[1] = (cfa_option){'b', "BBBB", "Second arg", b };
    7975                opts[2] = (cfa_option){'\0', "CC", "Third arg", c };
    80                 print_args_usage(1, fake_argv, opts, "Test usage", false);
    81         }
    82         else {
    83                 int status = do_wait(child);
    84                 print_status(status);
    85         }
     76                print_args_usage(1, fake_argv, opts, "Test usage", false );
     77        } else {
     78                int status = do_wait( child );
     79                print_status( status );
     80        } // if
    8681
    8782        sout | "Mix of short and long and some missing description:";
    88         if(pid_t child = strict_fork(); child == 0) {
     83        if ( pid_t child = strict_fork(); child == 0 ) {
    8984                int a, b, c;
    9085                array( cfa_option, 3 ) opts;
     
    9287                opts[1] = (cfa_option){'b', "BBBB", "", b };
    9388                opts[2] = (cfa_option){'\0', "CC", "Third arg", c };
    94                 print_args_usage(1, fake_argv, opts, "Test usage", false);
    95         }
    96         else {
    97                 int status = do_wait(child);
    98                 print_status(status);
    99         }
     89                print_args_usage(1, fake_argv, opts, "Test usage", false );
     90        } else {
     91                int status = do_wait( child );
     92                print_status( status );
     93        } // if
    10094
    10195        sout | "Mix of short and long and some long description:";
    102         if(pid_t child = strict_fork(); child == 0) {
     96        if ( pid_t child = strict_fork(); child == 0 ) {
    10397                int a, b, c;
    10498                array( cfa_option, 3 ) opts;
     
    106100                opts[1] = (cfa_option){'b', "BBBB", "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", b };
    107101                opts[2] = (cfa_option){'\0', "CC", "Third arg", c };
    108                 print_args_usage(1, fake_argv, opts, "Test usage", false);
    109         }
    110         else {
    111                 int status = do_wait(child);
    112                 print_status(status);
    113         }
     102                print_args_usage(1, fake_argv, opts, "Test usage", false );
     103        } else {
     104                int status = do_wait( child );
     105                print_status( status );
     106        } // if
    114107}
    115108
    116109// no used
    117 static int true_main(const char * path, char * env[]) { return 0; }
     110static int true_main( const char * path, char * env[]) { return 0; }
Note: See TracChangeset for help on using the changeset viewer.