Changeset 41:a3f71b4eaca1 in xplra for test/multigetctest.c


Ignore:
Timestamp:
02/14/13 18:32:21 (11 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Added test cases for the 'unknown dataref' error with position information

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/multigetctest.c

    r30 r41  
    5151
    5252    int connectionID = -1;
     53    int wrongGetterID = -1;
    5354    int getterID = -1;
    5455
     
    147148        goto cleanup;
    148149    }
     150
     151    wrongGetterID = xplra_multi_create_getter(connectionID);
     152    if (wrongGetterID<0) goto error;
     153    xplra_multi_add_int(wrongGetterID, "sim/time/local_date_days");
     154    xplra_multi_add_int(wrongGetterID, "sim/time/paused");
     155    xplra_multi_add_int(wrongGetterID, "sim/time/hello_te_lo");
     156    xplra_multi_add_float(wrongGetterID, "sim/time/zulu_time_sec");
     157    xplra_multi_add_int(wrongGetterID, "sim/operation/prefs/replay_mode");
     158
     159    printf("Executing a multi-dataref getter with an invalid dataref...\n");
     160    if (xplra_multi_execute(wrongGetterID)<0) {
     161        printf("Error occured: %s\n\n",
     162               xplra_get_last_error_string(connectionID));
     163        xplra_clear_last_error(connectionID);
     164    } else {
     165        printf(">>>>>>>>>>>>>>>>>>>>> Succeeded, but it should not have!!!!\n\n");
     166    }
     167
     168    printf("Executing a registered multi-dataref getter with an invalid dataref...\n");
     169    if (xplra_multi_register(wrongGetterID)<0) goto error;
     170    if (xplra_multi_execute(wrongGetterID)<0) {
     171        printf("Error occured: %s\n\n",
     172               xplra_get_last_error_string(connectionID));
     173        xplra_clear_last_error(connectionID);
     174    } else {
     175        printf(">>>>>>>>>>>>>>>>>>>>> Succeeded, but it should not have!!!!\n\n");
     176    }
     177
    149178
    150179    getterID = xplra_multi_create_getter(connectionID);
Note: See TracChangeset for help on using the changeset viewer.