Changeset 9b20126 in mainline for uspace/lib/pcut/tests/beforeafter.c
- Timestamp:
- 2014-09-19T08:23:01Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c85a57f
- Parents:
- 15d0046
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/pcut/tests/beforeafter.c
r15d0046 r9b20126 27 27 */ 28 28 29 #define _BSD_SOURCE 30 29 31 #include <pcut/pcut.h> 30 32 #include <stdlib.h> 31 33 #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 32 42 33 43 PCUT_INIT … … 36 46 #define BUFFER_SIZE 512 37 47 38 PCUT_TEST_SUITE(suite_with_setup_and_teardown) 48 PCUT_TEST_SUITE(suite_with_setup_and_teardown); 39 49 40 50 PCUT_TEST_BEFORE { … … 48 58 } 49 59 50 PCUT_TEST( snprintf) {60 PCUT_TEST(test_with_setup_and_teardown) { 51 61 snprintf(buffer, BUFFER_SIZE - 1, "%d-%s", 56, "abcd"); 52 62 PCUT_ASSERT_STR_EQUALS("56-abcd", buffer); 53 63 } 54 64 55 PCUT_TEST_SUITE(another_without_setup) 65 PCUT_TEST_SUITE(another_without_setup); 56 66 57 PCUT_TEST( whatever) {67 PCUT_TEST(test_without_any_setup_or_teardown) { 58 68 PCUT_ASSERT_NULL(buffer); 59 69 }
Note:
See TracChangeset
for help on using the changeset viewer.