Esempio n. 1
0
TEST(TestHarness_c, cpputest_realloc_larger)
{
	const char* number_string = "123456789";

	char* mem1 = (char*) cpputest_malloc(10);

	PlatformSpecificStrCpy(mem1, number_string);
	CHECK(mem1 != 0);

	char* mem2 = (char*) cpputest_realloc(mem1, 1000);

	CHECK(mem2 != 0);
	STRCMP_EQUAL(number_string, mem2);

	cpputest_free(mem2);
}
Esempio n. 2
0
TEST(TestHarness_c, cpputest_realloc_larger)
{
    const char* number_string = "123456789";

    char* mem1 = (char*) cpputest_malloc(10);

    SimpleString::StrNCpy(mem1, number_string, 10);

    CHECK(mem1 != NULLPTR);

    char* mem2 = (char*) cpputest_realloc(mem1, 1000);

    CHECK(mem2 != NULLPTR);
    STRCMP_EQUAL(number_string, mem2);

    cpputest_free(mem2);
}