当前位置: 首页>>代码示例>>C++>>正文


C++ CuFail_Line函数代码示例

本文整理汇总了C++中CuFail_Line函数的典型用法代码示例。如果您正苦于以下问题:C++ CuFail_Line函数的具体用法?C++ CuFail_Line怎么用?C++ CuFail_Line使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了CuFail_Line函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: CuAssertPtrEquals_LineMsg

void CuAssertPtrEquals_LineMsg(CuTest *tc, const char *file, int line, const char *message,
                               void *expected, void *actual) {
    char buf[STRING_MAX];
    if (expected == actual) return;
    sprintf(buf, "expected pointer <0x%p> but was <0x%p>", expected, actual);
    CuFail_Line(tc, file, line, message, buf);
}
开发者ID:josiahcampbell,项目名称:cis343,代码行数:7,代码来源:CuTest.c

示例2: CuAssertIntEquals_LineMsg

void CuAssertIntEquals_LineMsg(CuTest *tc, const char *file, int line, const char *message,
                               int expected, int actual) {
    char buf[STRING_MAX];
    if (expected == actual) return;
    sprintf(buf, "expected <%d> but was <%d>", expected, actual);
    CuFail_Line(tc, file, line, message, buf);
}
开发者ID:josiahcampbell,项目名称:cis343,代码行数:7,代码来源:CuTest.c

示例3: CuAssertDblEquals_LineMsg

void CuAssertDblEquals_LineMsg(CuTest* tc, const char* file, int line, const char* message,
                               double expected, double actual, double delta)
{
    char buf[STRING_MAX];
    if (fabs(expected - actual) <= delta) return;
    sprintf(buf, "expected <%e> but was <%e>", expected, actual);
    CuFail_Line(tc, file, line, message, buf);
}
开发者ID:remysaissy,项目名称:libslds,代码行数:8,代码来源:CuTest.c

示例4: CuAssertPtrNotEqual_LineMsg

void CuAssertPtrNotEqual_LineMsg(CuTest* tc, const char* file, int line,
                                 const char* message,
                                 const void* expected, const void* actual) {
	char buf[STRING_MAX];
	if (expected != actual) return;
	sprintf(buf, "expected pointer <0x%p> to be different from <0x%p>",
            expected, actual);
	CuFail_Line(tc, file, line, message, buf);
}
开发者ID:turingmachine,项目名称:augeas,代码行数:9,代码来源:cutest.c

示例5: CuAssert_Line

bool CuAssert_Line (CuTest_t *tc, const char *file, unsigned long int line, const char *message, int condition) {
    if (tc) {
        ++tc->assertCnt;

        if (condition) return false;

        CuFail_Line (tc, file, line, message, NULL);
        return true;
    }

    return false;
}
开发者ID:MonteCarlos,项目名称:Cutest-CC65-Version,代码行数:12,代码来源:CuTestAssertLine.c

示例6: Extended_CuAssertIntArrayEquals_LineMsg

void Extended_CuAssertIntArrayEquals_LineMsg(CuTest* tc, const char* file, int line, const char* message, int* expected, int* actual, int elementCount)
{
	int i;
	char buf[STRING_MAX];

	for(i = 0; i < elementCount; ++i)
	{
		if(expected[i] != actual[i])
		{
			sprintf(buf, "Mismatched elements at index [%d]: Expected (%d) but found (%d)", i, expected[i], actual[i]);
			CuFail_Line(tc, file, line, message, buf);
		}
	}
	return;
}
开发者ID:neutrinog,项目名称:Crest---Tarantula,代码行数:15,代码来源:CrestTests.c

示例7: CuAssertGeneralEquals_LineMsg

bool CuAssertGeneralEquals_LineMsg(CuTest_t* tc, const char* file, unsigned long int line, const char* message,
	const void *expected, const void *actual, char *expectedStr, char *actualStr, size_t maxStrLen, CuTestCmpFncPtr_t cmpFnc)
{
	if (tc){
		bool result;

        //increase counter for assertions within that test
        ++tc->assertCnt;

        //char *expectedStr=NULL, *actualStr=NULL; //init to NULL to enable tracking of missing ptr assignment
        // CuString *cmpmsg = CuStringNew();
        //char* buf = (char*)calloc(STRING_MAX, sizeof(char));
        //assert (NULL != buf);
        //String functions will create new instance if NULL Ptr is passed
        //CuString *compResult = CuStringNew();
        if ( false == (result = cmpFnc (expected, actual, expectedStr, actualStr, maxStrLen, tc->message/*cmpmsg*/) ) ) {
            assert (NULL != expectedStr);
            assert (NULL != actualStr);

            //sprintf(buf, "expected <%d> but was <%d>", expected, actual);
            CuFail_Line (tc, file, line, message, " ");
            //CuStringAppend(tc->message, ": ");

			//here axctual and expected are exchanged which is reasoned in the va macros used in more deeply nested function
			//CuStringAppendISvsNOT(tc->message, "%d", actual, expected);
			CuStringAppendISvsNOT(tc->message, "%s", actualStr, expectedStr);
		   // CuTestAppendMessage(tc, CuStringCStr(cmpmsg));
			//return true;
		}
		//CuStringDelete(compResult);
		//free(buf);
		//CuStringDelete(cmpmsg);
		return !result;
	}
	return true;
}
开发者ID:MonteCarlos,项目名称:Cutest-CC65-Version,代码行数:36,代码来源:CuTestAssertGeneralEqualsLineMsg.c

示例8: CuAssert_Line

void CuAssert_Line(CuTest* tc, const char* file, int line, const char* message, int condition)
{
    if (condition) return;
    CuFail_Line(tc, file, line, NULL, message);
}
开发者ID:remysaissy,项目名称:libslds,代码行数:5,代码来源:CuTest.c

示例9: CuTestAssertForDb

void CuTestAssertForDb(const char *msg, const char *file, int line)
{
	CuFail_Line(NULL, file, line, NULL, msg);
}
开发者ID:hyc,项目名称:BerkeleyDB,代码行数:4,代码来源:Runner.c


注:本文中的CuFail_Line函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。