| 721 | //========================================================================== |
| 722 | |
| 723 | CCMD (test) |
| 724 | { |
| 725 | int parsept = 1; |
| 726 | FProduction *prod = ParseExpression (argv, parsept); |
| 727 | |
| 728 | if (prod == NULL || parsept >= argv.argc()) |
| 729 | { |
| 730 | Printf ("Usage: test <expr> <true cmd> [false cmd]\n"); |
| 731 | } |
| 732 | else |
| 733 | { |
| 734 | if (prod->Type == PROD_String) |
| 735 | { |
| 736 | prod = StringToDouble (prod); |
| 737 | } |
| 738 | |
| 739 | if (static_cast<FDoubleProd *>(prod)->Value != 0.0) |
| 740 | { |
| 741 | AddCommandString (argv[parsept]); |
| 742 | } |
| 743 | else if (++parsept < argv.argc()) |
| 744 | { |
| 745 | AddCommandString (argv[parsept]); |
| 746 | } |
| 747 | } |
| 748 | if (prod != NULL) |
| 749 | { |
| 750 | M_Free (prod); |
| 751 | } |
| 752 | } |
| 753 | |
| 754 | //========================================================================== |
| 755 | // |
nothing calls this directly
no test coverage detected