您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ CuFail_Line函数代码示例

51自学网 2021-06-01 20:15:50
  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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例9: CuTestAssertForDb

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



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


C++ CuStringAppend函数代码示例
C++ CuAssertTrue函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。