Files
arcs/arcs-sdk/modules/cpputest/tests/CppUTest/CheatSheetTest.cpp
2026-08-13 16:50:52 +08:00

36 lines
803 B
C++

static void (*real_one) ();
static void stub(){}
/* in CheatSheetTest.cpp */
#include "CppUTest/TestHarness.h"
/* Declare TestGroup with name CheatSheet */
TEST_GROUP(CheatSheet)
{
/* declare a setup method for the test group. Optional. */
void setup() CPPUTEST_OVERRIDE
{
/* Set method real_one to stub. Automatically restore in teardown */
UT_PTR_SET(real_one, stub);
}
/* Declare a teardown method for the test group. Optional */
void teardown() CPPUTEST_OVERRIDE
{
}
}; /* Do not forget semicolumn */
/* Declare one test within the test group */
TEST(CheatSheet, TestName)
{
/* Check two longs are equal */
LONGS_EQUAL(1, 1);
/* Check a condition */
CHECK(true == true);
/* Check a string */
STRCMP_EQUAL("HelloWorld", "HelloWorld");
}