MCPcopy Create free account
hub / github.com/cpputest/cpputest / functionThatReturnsAValue

Function functionThatReturnsAValue

tests/CppUTest/TestUTestMacro.cpp:916–943  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

914}
915
916static int functionThatReturnsAValue()
917{
918 CHECK(0 == 0);
919 CHECK_TEXT(0 == 0, "Shouldn't fail");
920 CHECK_TRUE(0 == 0);
921 CHECK_TRUE_TEXT(0 == 0, "Shouldn't fail");
922 CHECK_FALSE(0 != 0);
923 CHECK_FALSE_TEXT(0 != 0, "Shouldn't fail");
924 LONGS_EQUAL(1,1);
925 LONGS_EQUAL_TEXT(1, 1, "Shouldn't fail");
926 BYTES_EQUAL(0xab,0xab);
927 BYTES_EQUAL_TEXT(0xab, 0xab, "Shouldn't fail");
928 CHECK_EQUAL(100,100);
929 CHECK_EQUAL_TEXT(100, 100, "Shouldn't fail");
930 STRCMP_EQUAL("THIS", "THIS");
931 STRCMP_EQUAL_TEXT("THIS", "THIS", "Shouldn't fail");
932 DOUBLES_EQUAL(1.0, 1.0, .01);
933 DOUBLES_EQUAL_TEXT(1.0, 1.0, .01, "Shouldn't fail");
934 POINTERS_EQUAL(NULLPTR, NULLPTR);
935 POINTERS_EQUAL_TEXT(NULLPTR, NULLPTR, "Shouldn't fail");
936 MEMCMP_EQUAL("THIS", "THIS", 5);
937 MEMCMP_EQUAL_TEXT("THIS", "THIS", 5, "Shouldn't fail");
938 BITS_EQUAL(0x01, (unsigned char )0x01, 0xFF);
939 BITS_EQUAL(0x0001, (unsigned short )0x0001, 0xFFFF);
940 BITS_EQUAL(0x00000001, (unsigned long )0x00000001, 0xFFFFFFFF);
941 BITS_EQUAL_TEXT(0x01, (unsigned char )0x01, 0xFF, "Shouldn't fail");
942 return 0;
943}
944
945TEST(UnitTestMacros, allMacrosFromFunctionThatReturnsAValue)
946{

Callers 1

TESTFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected