Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/pcut/src/os/helenos.c

    rb7fd2a0 r8e3498b  
    6868}
    6969
    70 void pcut_str_error(errno_t error, char *buffer, int size) {
     70void pcut_str_error(int error, char *buffer, int size) {
    7171        const char *str = str_error(error);
    7272        if (str == NULL) {
     
    130130 * @return EOK Always.
    131131 */
    132 static errno_t test_timeout_handler_fibril(void *arg) {
     132static int test_timeout_handler_fibril(void *arg) {
    133133        pcut_item_t *test = arg;
    134134        int timeout_sec = pcut_get_test_timeout(test);
     
    139139                goto leave_no_kill;
    140140        }
    141         errno_t rc = fibril_condvar_wait_timeout(&forced_termination_cv,
     141        int rc = fibril_condvar_wait_timeout(&forced_termination_cv,
    142142                &forced_termination_mutex, timeout_us);
    143143        if (rc == ETIMEOUT) {
     
    154154 * @param test Test to be run.
    155155 */
    156 int pcut_run_test_forking(const char *self_path, pcut_item_t *test) {
     156void pcut_run_test_forking(const char *self_path, pcut_item_t *test) {
    157157        before_test_start(test);
    158158
    159159        char tempfile_name[PCUT_TEMP_FILENAME_BUFFER_SIZE];
    160160        snprintf(tempfile_name, PCUT_TEMP_FILENAME_BUFFER_SIZE - 1, "pcut_%lld.tmp", (unsigned long long) task_get_id());
    161         int tempfile;
    162         errno_t rc = vfs_lookup_open(tempfile_name, WALK_REGULAR | WALK_MAY_CREATE, MODE_READ | MODE_WRITE, &tempfile);
    163         if (rc != EOK) {
    164                 pcut_report_test_done(test, PCUT_OUTCOME_INTERNAL_ERROR, "Failed to create temporary file.", NULL, NULL);
    165                 return PCUT_OUTCOME_INTERNAL_ERROR;
     161        int tempfile = vfs_lookup_open(tempfile_name, WALK_REGULAR | WALK_MAY_CREATE, MODE_READ | MODE_WRITE);
     162        if (tempfile < 0) {
     163                pcut_report_test_done(test, TEST_OUTCOME_ERROR, "Failed to create temporary file.", NULL, NULL);
     164                return;
    166165        }
    167166
     
    175174        };
    176175
    177         int status = PCUT_OUTCOME_PASS;
     176        int status = TEST_OUTCOME_PASS;
    178177
    179178        task_wait_t test_task_wait;
    180         rc = task_spawnvf(&test_task_id, &test_task_wait, self_path, arguments,
     179        int rc = task_spawnvf(&test_task_id, &test_task_wait, self_path, arguments,
    181180            fileno(stdin), tempfile, tempfile);
    182181        if (rc != EOK) {
    183                 status = PCUT_OUTCOME_INTERNAL_ERROR;
     182                status = TEST_OUTCOME_ERROR;
    184183                goto leave_close_tempfile;
    185184        }
     
    199198        rc = task_wait(&test_task_wait, &task_exit, &task_retval);
    200199        if (rc != EOK) {
    201                 status = PCUT_OUTCOME_INTERNAL_ERROR;
     200                status = TEST_OUTCOME_ERROR;
    202201                goto leave_close_tempfile;
    203202        }
    204203        if (task_exit == TASK_EXIT_UNEXPECTED) {
    205                 status = PCUT_OUTCOME_INTERNAL_ERROR;
     204                status = TEST_OUTCOME_ERROR;
    206205        } else {
    207                 status = task_retval == 0 ? PCUT_OUTCOME_PASS : PCUT_OUTCOME_FAIL;
     206                status = task_retval == 0 ? TEST_OUTCOME_PASS : TEST_OUTCOME_FAIL;
    208207        }
    209208
     
    222221
    223222        pcut_report_test_done_unparsed(test, status, extra_output_buffer, OUTPUT_BUFFER_SIZE);
    224 
    225         return status;
    226223}
    227224
Note: See TracChangeset for help on using the changeset viewer.