Features
Features
API
These frameworks were designed as subset replacements for Googletest. The assertion names are shared by C11 and C++11; C generic comparisons accept scalar values, while C++ also accepts types that provide the corresponding operator.
C
The utest column refers to sheredom/utest.h.
| Macro or capability | jc_test C | utest.h |
|---|---|---|
| ASSERT_EQ/NE/LT/GT/LE/GE | Yes | Yes |
| ASSERT_ARRAY_EQ / ASSERT_ARRAY_EQ_LEN | Yes | ASSERT_MEMEQ |
| ASSERT_STREQ / ASSERT_STRNE | Yes | Yes |
| ASSERT_NEAR | Yes | Yes |
| ASSERT_DEATH | Yes | No |
| ASSERT_TRUE / ASSERT_FALSE | Yes | Yes |
| EXPECT_* variants | Yes | Yes |
| Skip current test | SKIP | UTEST_SKIP |
| Basic tests | TEST | UTEST |
| Fixtures | TEST_F | UTEST_F |
| Parameterized tests | No | No |
| Typed tests | No | No |
C++
| Macro or capability | jc_test C++ | GoogleTest |
|---|---|---|
| ASSERT_EQ/NE/LT/GT/LE/GE | Yes | Yes |
| ASSERT_ARRAY_EQ / ASSERT_ARRAY_EQ_LEN | Yes | No |
| ASSERT_STREQ / ASSERT_STRNE | Yes | Yes |
| ASSERT_NEAR | Yes | Yes |
| ASSERT_DEATH | Yes | Yes |
| ASSERT_TRUE / ASSERT_FALSE | Yes | Yes |
| EXPECT_* variants | Yes | Yes |
| Skip current test | SKIP | GTEST_SKIP |
| TEST | Yes | Yes |
| TEST_F | Yes | Yes |
| TEST_P | Yes | Yes |
| TYPED_TEST** | Yes | Yes |
ASSERT_FLOAT_EQ and ASSERT_DOUBLE_EQ are represented by ASSERT_EQ, with a margin of 4 ULP.
**) A maximum number of 4 test types per typed test
Other frameworks
See Benchmarks for same-language C and C++ comparisons and reproduction instructions. C and C++ frameworks are kept in separate tables because their compiler and runtime results are not directly comparable.
Last updated on