Ignore:
File:
1 edited

Legend:

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

    r9eb1ff5 r8d2dd7f2  
    3434#include <stdlib.h>
    3535#include <stdio.h>
    36 #include <sys/types.h>
    3736#include <errno.h>
    3837#include <assert.h>
     
    9594static int convert_wait_status_to_outcome(int status) {
    9695        if (status < 0) {
    97                 return PCUT_OUTCOME_INTERNAL_ERROR;
     96                return TEST_OUTCOME_ERROR;
    9897        } else if (status == 0) {
    99                 return PCUT_OUTCOME_PASS;
     98                return TEST_OUTCOME_PASS;
    10099        } else {
    101                 return PCUT_OUTCOME_FAIL;
     100                return TEST_OUTCOME_FAIL;
    102101        }
    103102}
     
    108107 * @param test Test to be run.
    109108 */
    110 int pcut_run_test_forking(const char *self_path, pcut_item_t *test) {
    111         int rc, outcome;
     109void pcut_run_test_forking(const char *self_path, pcut_item_t *test) {
     110        int rc;
    112111        FILE *tempfile;
    113112        char tempfile_name[PCUT_TEMP_FILENAME_BUFFER_SIZE];
     
    127126        PCUT_DEBUG("system() returned 0x%04X", rc);
    128127
    129         outcome = convert_wait_status_to_outcome(rc);
     128        rc = convert_wait_status_to_outcome(rc);
    130129
    131130        tempfile = fopen(tempfile_name, "rb");
    132131        if (tempfile == NULL) {
    133132                pcut_report_test_done(test, TEST_OUTCOME_ERROR, "Failed to open temporary file.", NULL, NULL);
    134                 return PCUT_OUTCOME_INTERNAL_ERROR;
     133                return;
    135134        }
    136135
    137136        fread(extra_output_buffer, 1, OUTPUT_BUFFER_SIZE, tempfile);
    138137        fclose(tempfile);
    139         remove(tempfile_name);
     138        unlink(tempfile_name);
    140139
    141         pcut_report_test_done_unparsed(test, outcome, extra_output_buffer, OUTPUT_BUFFER_SIZE);
    142 
    143         return outcome;
     140        pcut_report_test_done_unparsed(test, rc, extra_output_buffer, OUTPUT_BUFFER_SIZE);
    144141}
    145142
Note: See TracChangeset for help on using the changeset viewer.