Changeset 1433ecda in mainline for uspace/lib/pcut/src/os/windows.c


Ignore:
Timestamp:
2018-04-04T15:42:37Z (7 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2c4e1cc
Parents:
47b2d7e3
Message:

Fix cstyle: make ccheck-fix and commit only files where all the changes are good.

File:
1 edited

Legend:

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

    r47b2d7e3 r1433ecda  
    6161 * @param test Test that is about to be run.
    6262 */
    63 static void before_test_start(pcut_item_t *test) {
     63static void before_test_start(pcut_item_t *test)
     64{
    6465        pcut_report_test_start(test);
    6566
     
    7374 * @param failed_function_name Name of the failed function.
    7475 */
    75 static void report_func_fail(pcut_item_t *test, const char *failed_function_name) {
     76static void report_func_fail(pcut_item_t *test, const char *failed_function_name)
     77{
    7678        /* TODO: get error description. */
    7779        sprintf_s(error_message_buffer, OUTPUT_BUFFER_SIZE - 1,
    78                 "%s failed: %s.", failed_function_name, "unknown reason");
     80            "%s failed: %s.", failed_function_name, "unknown reason");
    7981        pcut_report_test_done(test, TEST_OUTCOME_ERROR, error_message_buffer, NULL, NULL);
    8082}
     
    9193 * @return Number of actually read bytes.
    9294 */
    93 static size_t read_all(HANDLE fd, char *buffer, size_t buffer_size) {
     95static size_t read_all(HANDLE fd, char *buffer, size_t buffer_size)
     96{
    9497        DWORD actually_read;
    9598        char *buffer_start = buffer;
     
    125128};
    126129
    127 static DWORD WINAPI read_test_output_on_background(LPVOID test_output_data_ptr) {
     130static DWORD WINAPI read_test_output_on_background(LPVOID test_output_data_ptr)
     131{
    128132        size_t stderr_size = 0;
    129133        struct test_output_data *test_output_data = (struct test_output_data *) test_output_data_ptr;
    130134
    131135        stderr_size = read_all(test_output_data->pipe_stderr,
    132                 test_output_data->output_buffer,
    133                 test_output_data->output_buffer_size - 1);
     136            test_output_data->output_buffer,
     137            test_output_data->output_buffer_size - 1);
    134138        read_all(test_output_data->pipe_stdout,
    135                 test_output_data->output_buffer,
    136                 test_output_data->output_buffer_size - 1 - stderr_size);
     139            test_output_data->output_buffer,
     140            test_output_data->output_buffer_size - 1 - stderr_size);
    137141
    138142        return 0;
     
    144148 * @param test Test to be run.
    145149 */
    146 int pcut_run_test_forking(const char *self_path, pcut_item_t *test) {
     150int pcut_run_test_forking(const char *self_path, pcut_item_t *test)
     151{
    147152        /* TODO: clean-up if something goes wrong "in the middle" */
    148153        BOOL okay = FALSE;
     
    216221        /* Format the command line. */
    217222        sprintf_s(command, PCUT_COMMAND_LINE_BUFFER_SIZE - 1,
    218                 "\"%s\" -t%d", self_path, test->id);
     223            "\"%s\" -t%d", self_path, test->id);
    219224
    220225        /* Run the process. */
    221226        okay = CreateProcess(NULL, command, NULL, NULL, TRUE, 0, NULL, NULL,
    222                 &start_info, &process_info);
     227            &start_info, &process_info);
    223228
    224229        if (!okay) {
     
    262267
    263268        test_output_thread_reader = CreateThread(NULL, 0,
    264                 read_test_output_on_background, &test_output_data,
    265                 0, NULL);
     269            read_test_output_on_background, &test_output_data,
     270            0, NULL);
    266271
    267272        if (test_output_thread_reader == NULL) {
     
    317322}
    318323
    319 void pcut_hook_before_test(pcut_item_t *test) {
     324void pcut_hook_before_test(pcut_item_t *test)
     325{
    320326        PCUT_UNUSED(test);
    321327
Note: See TracChangeset for help on using the changeset viewer.