2 * try to convert 'inputType' in 'outputType' * return 0 on failure, an index (<>0) on success */
| 595 | * return 0 on failure, an index (<>0) on success |
| 596 | */ |
| 597 | int iiTestConvert (int inputType, int outputType,const struct sConvertTypes *dConvertTypes) |
| 598 | { |
| 599 | if ((inputType==outputType) |
| 600 | || (outputType==DEF_CMD) |
| 601 | || (outputType==IDHDL) |
| 602 | || (outputType==ANY_TYPE)) |
| 603 | { |
| 604 | return -1; |
| 605 | } |
| 606 | if (inputType==UNKNOWN) return 0; |
| 607 | |
| 608 | if ((currRing==NULL) && (outputType>BEGIN_RING) && (outputType<END_RING)) |
| 609 | return 0; |
| 610 | //if ((currRing==NULL) && (outputType==CNUMBER_CMD)) |
| 611 | // return 0; |
| 612 | |
| 613 | // search the list |
| 614 | int i=0; |
| 615 | while (dConvertTypes[i].i_typ!=0) |
| 616 | { |
| 617 | if((dConvertTypes[i].i_typ==inputType) |
| 618 | &&(dConvertTypes[i].o_typ==outputType)) |
| 619 | { |
| 620 | //Print("test convert %d to %d (%s -> %s):%d\n",inputType,outputType, |
| 621 | //Tok2Cmdname(inputType), Tok2Cmdname(outputType),i+1); |
| 622 | return i+1; |
| 623 | } |
| 624 | i++; |
| 625 | } |
| 626 | //Print("test convert %d to %d (%s -> %s):0, tested:%d\n",inputType,outputType, |
| 627 | // Tok2Cmdname(inputType), Tok2Cmdname(outputType),i); |
| 628 | return 0; |
| 629 | } |
no outgoing calls
no test coverage detected