Changeset 9b20126 in mainline for uspace/lib/pcut/tests/beforeafter.c


Ignore:
Timestamp:
2014-09-19T08:23:01Z (10 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c85a57f
Parents:
15d0046
Message:

Update PCUT to newest version

File:
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/pcut/tests/beforeafter.c

    r15d0046 r9b20126  
    2727 */
    2828
     29#define _BSD_SOURCE
     30
    2931#include <pcut/pcut.h>
    3032#include <stdlib.h>
    3133#include <stdio.h>
     34
     35/*
     36 * Use sprintf_s in Windows but only with Microsoft compiler.
     37 * Namely, let MinGW use snprintf.
     38 */
     39#if (defined(__WIN64) || defined(__WIN32) || defined(_WIN32)) && defined(_MSC_VER)
     40#define snprintf sprintf_s
     41#endif
    3242
    3343PCUT_INIT
     
    3646#define BUFFER_SIZE 512
    3747
    38 PCUT_TEST_SUITE(suite_with_setup_and_teardown)
     48PCUT_TEST_SUITE(suite_with_setup_and_teardown);
    3949
    4050PCUT_TEST_BEFORE {
     
    4858}
    4959
    50 PCUT_TEST(snprintf) {
     60PCUT_TEST(test_with_setup_and_teardown) {
    5161        snprintf(buffer, BUFFER_SIZE - 1, "%d-%s", 56, "abcd");
    5262        PCUT_ASSERT_STR_EQUALS("56-abcd", buffer);
    5363}
    5464
    55 PCUT_TEST_SUITE(another_without_setup)
     65PCUT_TEST_SUITE(another_without_setup);
    5666
    57 PCUT_TEST(whatever) {
     67PCUT_TEST(test_without_any_setup_or_teardown) {
    5868        PCUT_ASSERT_NULL(buffer);
    5969}
Note: See TracChangeset for help on using the changeset viewer.