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


C++ UNITY_TEST_ASSERT_NOT_NULL函数代码示例

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


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

示例1: initTokenizer_CMockIgnoreAndReturn

void initTokenizer_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, Tokenizer* cmock_to_return)
{
  CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_initTokenizer_CALL_INSTANCE));
  CMOCK_initTokenizer_CALL_INSTANCE* cmock_call_instance = (CMOCK_initTokenizer_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);
  UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "CMock has run out of memory. Please allocate more.");
  Mock.initTokenizer_CallInstance = CMock_Guts_MemChain(Mock.initTokenizer_CallInstance, cmock_guts_index);
  cmock_call_instance->LineNumber = cmock_line;
  cmock_call_instance->ExceptionToThrow = CEXCEPTION_NONE;
  cmock_call_instance->ReturnVal = cmock_to_return;
  Mock.initTokenizer_IgnoreBool = (int)1;
}
开发者ID:jasonchuah93,项目名称:LatestShuntingYard,代码行数:11,代码来源:mock_initializeToken.c

示例2: calculate_CMockExpectAndReturn

void calculate_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, Operator* opeToken, Number* first, Number* second, Token* cmock_to_return)
{
  CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_calculate_CALL_INSTANCE));
  CMOCK_calculate_CALL_INSTANCE* cmock_call_instance = (CMOCK_calculate_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);
  UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "CMock has run out of memory. Please allocate more.");
  Mock.calculate_CallInstance = CMock_Guts_MemChain(Mock.calculate_CallInstance, cmock_guts_index);
  cmock_call_instance->LineNumber = cmock_line;
  cmock_call_instance->CallOrder = ++GlobalExpectCount;
  CMockExpectParameters_calculate(cmock_call_instance, opeToken, first, second);
  cmock_call_instance->ReturnVal = cmock_to_return;
}
开发者ID:jasonchuah93,项目名称:JasonShuntingYard,代码行数:11,代码来源:mock_calculateToken.c

示例3: Stack_push_CMockExpect

void Stack_push_CMockExpect(UNITY_LINE_TYPE cmock_line, Stack* stack, void* element)
{
  CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_Stack_push_CALL_INSTANCE));
  CMOCK_Stack_push_CALL_INSTANCE* cmock_call_instance = (CMOCK_Stack_push_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);
  UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "CMock has run out of memory. Please allocate more.");
  Mock.Stack_push_CallInstance = CMock_Guts_MemChain(Mock.Stack_push_CallInstance, cmock_guts_index);
  cmock_call_instance->LineNumber = cmock_line;
  cmock_call_instance->CallOrder = ++GlobalExpectCount;
  cmock_call_instance->ExceptionToThrow = CEXCEPTION_NONE;
  CMockExpectParameters_Stack_push(cmock_call_instance, stack, element);
}
开发者ID:9drashijin,项目名称:Institutions,代码行数:11,代码来源:mock_Stack.c

示例4: system_write_CMockExpect

void system_write_CMockExpect(UNITY_LINE_TYPE cmock_line, S_DATA* dest, S_DATA value)
{
  CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_system_write_CALL_INSTANCE));
  CMOCK_system_write_CALL_INSTANCE* cmock_call_instance = (CMOCK_system_write_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);
  UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory);
  memset(cmock_call_instance, 0, sizeof(*cmock_call_instance));
  Mock.system_write_CallInstance = CMock_Guts_MemChain(Mock.system_write_CallInstance, cmock_guts_index);
  cmock_call_instance->LineNumber = cmock_line;
  CMockExpectParameters_system_write(cmock_call_instance, dest, value);
  UNITY_CLR_DETAILS();
}
开发者ID:BookProjects,项目名称:main_project,代码行数:11,代码来源:mock_system_memory_internals.c

示例5: Stack_create_CMockExpectAndReturn

void Stack_create_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, Stack* cmock_to_return)
{
  CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_Stack_create_CALL_INSTANCE));
  CMOCK_Stack_create_CALL_INSTANCE* cmock_call_instance = (CMOCK_Stack_create_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);
  UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "CMock has run out of memory. Please allocate more.");
  Mock.Stack_create_CallInstance = CMock_Guts_MemChain(Mock.Stack_create_CallInstance, cmock_guts_index);
  cmock_call_instance->LineNumber = cmock_line;
  cmock_call_instance->CallOrder = ++GlobalExpectCount;
  cmock_call_instance->ExceptionToThrow = CEXCEPTION_NONE;
  cmock_call_instance->ReturnVal = cmock_to_return;
}
开发者ID:Raydivine,项目名称:Insitution,代码行数:11,代码来源:mock_Stack.c

示例6: system_read_CMockExpectAndReturn

void system_read_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, S_DATA* src, S_DATA cmock_to_return)
{
  CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_system_read_CALL_INSTANCE));
  CMOCK_system_read_CALL_INSTANCE* cmock_call_instance = (CMOCK_system_read_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);
  UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory);
  memset(cmock_call_instance, 0, sizeof(*cmock_call_instance));
  Mock.system_read_CallInstance = CMock_Guts_MemChain(Mock.system_read_CallInstance, cmock_guts_index);
  cmock_call_instance->LineNumber = cmock_line;
  CMockExpectParameters_system_read(cmock_call_instance, src);
  memcpy(&cmock_call_instance->ReturnVal, &cmock_to_return, sizeof(S_DATA));
  UNITY_CLR_DETAILS();
}
开发者ID:BookProjects,项目名称:main_project,代码行数:12,代码来源:mock_system_memory_internals.c

示例7: stringCopy_CMockExpectAndThrow

void stringCopy_CMockExpectAndThrow(UNITY_LINE_TYPE cmock_line, char* source, char* destination, int startLocation, int length, CEXCEPTION_T cmock_to_throw)
{
  CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_stringCopy_CALL_INSTANCE));
  CMOCK_stringCopy_CALL_INSTANCE* cmock_call_instance = (CMOCK_stringCopy_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);
  UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "CMock has run out of memory. Please allocate more.");
  Mock.stringCopy_CallInstance = CMock_Guts_MemChain(Mock.stringCopy_CallInstance, cmock_guts_index);
  cmock_call_instance->LineNumber = cmock_line;
  cmock_call_instance->CallOrder = ++GlobalExpectCount;
  cmock_call_instance->ExceptionToThrow = CEXCEPTION_NONE;
  CMockExpectParameters_stringCopy(cmock_call_instance, source, destination, startLocation, length);
  cmock_call_instance->ExceptionToThrow = cmock_to_throw;
}
开发者ID:jasonchuah93,项目名称:LatestShuntingYard,代码行数:12,代码来源:mock_StringObject.c

示例8: system_init_CMockExpectAndReturn

void system_init_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, void* base_address, uint32_t type_size, void* cmock_to_return)
{
  CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_system_init_CALL_INSTANCE));
  CMOCK_system_init_CALL_INSTANCE* cmock_call_instance = (CMOCK_system_init_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);
  UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory);
  memset(cmock_call_instance, 0, sizeof(*cmock_call_instance));
  Mock.system_init_CallInstance = CMock_Guts_MemChain(Mock.system_init_CallInstance, cmock_guts_index);
  cmock_call_instance->LineNumber = cmock_line;
  CMockExpectParameters_system_init(cmock_call_instance, base_address, type_size);
  cmock_call_instance->ReturnVal = cmock_to_return;
  UNITY_CLR_DETAILS();
}
开发者ID:BookProjects,项目名称:main_project,代码行数:12,代码来源:mock_system_memory_internals.c

示例9: getWordAndUpdate_CMockExpectAndThrow

void getWordAndUpdate_CMockExpectAndThrow(UNITY_LINE_TYPE cmock_line, String* line, char* delimiter, CEXCEPTION_T cmock_to_throw)
{
  CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_getWordAndUpdate_CALL_INSTANCE));
  CMOCK_getWordAndUpdate_CALL_INSTANCE* cmock_call_instance = (CMOCK_getWordAndUpdate_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);
  UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "CMock has run out of memory. Please allocate more.");
  Mock.getWordAndUpdate_CallInstance = CMock_Guts_MemChain(Mock.getWordAndUpdate_CallInstance, cmock_guts_index);
  cmock_call_instance->LineNumber = cmock_line;
  cmock_call_instance->CallOrder = ++GlobalExpectCount;
  cmock_call_instance->ExceptionToThrow = CEXCEPTION_NONE;
  CMockExpectParameters_getWordAndUpdate(cmock_call_instance, line, delimiter);
  cmock_call_instance->ExceptionToThrow = cmock_to_throw;
}
开发者ID:jasonchuah93,项目名称:LatestShuntingYard,代码行数:12,代码来源:mock_StringObject.c

示例10: isNumber_CMockExpectAndThrow

void isNumber_CMockExpectAndThrow(UNITY_LINE_TYPE cmock_line, Token* unknownToken, CEXCEPTION_T cmock_to_throw)
{
  CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_isNumber_CALL_INSTANCE));
  CMOCK_isNumber_CALL_INSTANCE* cmock_call_instance = (CMOCK_isNumber_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index);
  UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "CMock has run out of memory. Please allocate more.");
  Mock.isNumber_CallInstance = CMock_Guts_MemChain(Mock.isNumber_CallInstance, cmock_guts_index);
  cmock_call_instance->LineNumber = cmock_line;
  cmock_call_instance->CallOrder = ++GlobalExpectCount;
  cmock_call_instance->ExceptionToThrow = CEXCEPTION_NONE;
  CMockExpectParameters_isNumber(cmock_call_instance, unknownToken);
  cmock_call_instance->ExceptionToThrow = cmock_to_throw;
}
开发者ID:jasonchuah93,项目名称:Calculator,代码行数:12,代码来源:mock_nextToken.c

示例11: mock_system_read_impl

S_DATA mock_system_read_impl(S_DATA* src)
{
  UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM;
  UNITY_SET_DETAIL(CMockString_system_read);
  CMOCK_system_read_CALL_INSTANCE* cmock_call_instance = (CMOCK_system_read_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.system_read_CallInstance);
  Mock.system_read_CallInstance = CMock_Guts_MemNext(Mock.system_read_CallInstance);
  UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringCalledMore);
  cmock_line = cmock_call_instance->LineNumber;
  {
    UNITY_SET_DETAILS(CMockString_system_read,CMockString_src);
    UNITY_TEST_ASSERT_EQUAL_PTR((void*)(cmock_call_instance->Expected_src), (void*)(src), cmock_line, CMockStringMismatch);
  }
  UNITY_CLR_DETAILS();
  return cmock_call_instance->ReturnVal;
}
开发者ID:BookProjects,项目名称:main_project,代码行数:15,代码来源:mock_system_memory_internals.c

示例12: LED_Toggle

void LED_Toggle(void)
{
  UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM;
  CMOCK_LED_Toggle_CALL_INSTANCE* cmock_call_instance = (CMOCK_LED_Toggle_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.LED_Toggle_CallInstance);
  Mock.LED_Toggle_CallInstance = CMock_Guts_MemNext(Mock.LED_Toggle_CallInstance);
  if (Mock.LED_Toggle_IgnoreBool)
  {
    return;
  }
  UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "Function 'LED_Toggle' called more times than expected.");
  cmock_line = cmock_call_instance->LineNumber;
  if (cmock_call_instance->CallOrder > ++GlobalVerifyOrder)
    UNITY_TEST_FAIL(cmock_line, "Function 'LED_Toggle' called earlier than expected.");
  if (cmock_call_instance->CallOrder < GlobalVerifyOrder)
    UNITY_TEST_FAIL(cmock_line, "Function 'LED_Toggle' called later than expected.");
}
开发者ID:ThrowTheSwitch,项目名称:blinky,代码行数:16,代码来源:MockLED.c

示例13: qeocore_remote_registration_init_cond

void qeocore_remote_registration_init_cond(void)
{
  UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM;
  CMOCK_qeocore_remote_registration_init_cond_CALL_INSTANCE* cmock_call_instance = (CMOCK_qeocore_remote_registration_init_cond_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.qeocore_remote_registration_init_cond_CallInstance);
  Mock.qeocore_remote_registration_init_cond_CallInstance = CMock_Guts_MemNext(Mock.qeocore_remote_registration_init_cond_CallInstance);
  if (Mock.qeocore_remote_registration_init_cond_IgnoreBool)
  {
    return;
  }
  if (Mock.qeocore_remote_registration_init_cond_CallbackFunctionPointer != NULL)
  {
    Mock.qeocore_remote_registration_init_cond_CallbackFunctionPointer(Mock.qeocore_remote_registration_init_cond_CallbackCalls++);
    return;
  }
  UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "Function 'qeocore_remote_registration_init_cond' called more times than expected.");
  cmock_line = cmock_call_instance->LineNumber;
}
开发者ID:JianlongCao,项目名称:qeo-core,代码行数:17,代码来源:Mockremote_registration.c

示例14: qeocore_remote_registration_set_key

void qeocore_remote_registration_set_key(EVP_PKEY* key)
{
  UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM;
  CMOCK_qeocore_remote_registration_set_key_CALL_INSTANCE* cmock_call_instance = (CMOCK_qeocore_remote_registration_set_key_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.qeocore_remote_registration_set_key_CallInstance);
  Mock.qeocore_remote_registration_set_key_CallInstance = CMock_Guts_MemNext(Mock.qeocore_remote_registration_set_key_CallInstance);
  if (Mock.qeocore_remote_registration_set_key_IgnoreBool)
  {
    return;
  }
  if (Mock.qeocore_remote_registration_set_key_CallbackFunctionPointer != NULL)
  {
    Mock.qeocore_remote_registration_set_key_CallbackFunctionPointer(key, Mock.qeocore_remote_registration_set_key_CallbackCalls++);
    return;
  }
  UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "Function 'qeocore_remote_registration_set_key' called more times than expected.");
  cmock_line = cmock_call_instance->LineNumber;
  UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(cmock_call_instance->Expected_key), (void*)(key), sizeof(EVP_PKEY), cmock_line, "Function 'qeocore_remote_registration_set_key' called with unexpected value for argument 'key'.");
}
开发者ID:JianlongCao,项目名称:qeo-core,代码行数:18,代码来源:Mockremote_registration.c

示例15: qeo_deviceinfo_publish

void qeo_deviceinfo_publish(qeo_factory_t* factory)
{
  UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM;
  CMOCK_qeo_deviceinfo_publish_CALL_INSTANCE* cmock_call_instance = (CMOCK_qeo_deviceinfo_publish_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.qeo_deviceinfo_publish_CallInstance);
  Mock.qeo_deviceinfo_publish_CallInstance = CMock_Guts_MemNext(Mock.qeo_deviceinfo_publish_CallInstance);
  if (Mock.qeo_deviceinfo_publish_IgnoreBool)
  {
    return;
  }
  if (Mock.qeo_deviceinfo_publish_CallbackFunctionPointer != NULL)
  {
    Mock.qeo_deviceinfo_publish_CallbackFunctionPointer(factory, Mock.qeo_deviceinfo_publish_CallbackCalls++);
    return;
  }
  UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "Function 'qeo_deviceinfo_publish' called more times than expected.");
  cmock_line = cmock_call_instance->LineNumber;
  UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(cmock_call_instance->Expected_factory), (void*)(factory), sizeof(qeo_factory_t), cmock_line, "Function 'qeo_deviceinfo_publish' called with unexpected value for argument 'factory'.");
}
开发者ID:JianlongCao,项目名称:qeo-core,代码行数:18,代码来源:Mockdeviceinfo_writer.c


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