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


C++ CMock_Guts_MemNext函数代码示例

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


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

示例1: test_MemNextWillReturnNullIfGivenABadRoot

void test_MemNextWillReturnNullIfGivenABadRoot(void)
{
  TEST_ASSERT_EQUAL_HEX( CMOCK_GUTS_NONE, CMock_Guts_MemNext(0) );
  TEST_ASSERT_EQUAL_HEX( CMOCK_GUTS_NONE, CMock_Guts_MemNext(2) );
  TEST_ASSERT_EQUAL_HEX( CMOCK_GUTS_NONE, CMock_Guts_MemNext(CMOCK_MEM_SIZE - 4) );

  //verify we're cleared still
  TEST_ASSERT_EQUAL(0, CMock_Guts_MemBytesUsed());
  TEST_ASSERT_EQUAL(CMOCK_MEM_SIZE, CMock_Guts_MemBytesFree());
}
开发者ID:samchen2009,项目名称:CMock,代码行数:10,代码来源:TestCMockC.c

示例2: test_MemNextWillReturnNullIfGivenABadRoot

void test_MemNextWillReturnNullIfGivenABadRoot(void)
{
  TEST_ASSERT_NULL( CMock_Guts_MemNext(NULL) );
  TEST_ASSERT_NULL( CMock_Guts_MemNext((void*)2) );
  TEST_ASSERT_NULL( CMock_Guts_MemNext((void*)0xFFFFFFFE) );

  //verify we're cleared still
  TEST_ASSERT_EQUAL(0, CMock_Guts_MemBytesUsed());
  TEST_ASSERT_EQUAL(CMOCK_MEM_SIZE, CMock_Guts_MemBytesFree());
}
开发者ID:Cuixiaoxia198106,项目名称:nfc,代码行数:10,代码来源:TestCMockC.c

示例3: listAdd

void listAdd(List* list, int data)
{
  UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM;
  CMOCK_listAdd_CALL_INSTANCE* cmock_call_instance = (CMOCK_listAdd_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.listAdd_CallInstance);
  Mock.listAdd_CallInstance = CMock_Guts_MemNext(Mock.listAdd_CallInstance);
  if (Mock.listAdd_IgnoreBool)
  {
    return;
  }
  if (Mock.listAdd_CallbackFunctionPointer != NULL)
  {
    Mock.listAdd_CallbackFunctionPointer(list, data, Mock.listAdd_CallbackCalls++);
    return;
  }
  UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "Function 'listAdd' called more times than expected.");
  cmock_line = cmock_call_instance->LineNumber;
  if (cmock_call_instance->CallOrder > ++GlobalVerifyOrder)
    UNITY_TEST_FAIL(cmock_line, "Function 'listAdd' called earlier than expected.");
  if (cmock_call_instance->CallOrder < GlobalVerifyOrder)
    UNITY_TEST_FAIL(cmock_line, "Function 'listAdd' called later than expected.");
  UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(cmock_call_instance->Expected_list), (void*)(list), sizeof(List), cmock_line, "Function 'listAdd' called with unexpected value for argument 'list'.");
  UNITY_TEST_ASSERT_EQUAL_INT(cmock_call_instance->Expected_data, data, cmock_line, "Function 'listAdd' called with unexpected value for argument 'data'.");
  if (cmock_call_instance->ExceptionToThrow != CEXCEPTION_NONE)
  {
    Throw(cmock_call_instance->ExceptionToThrow);
  }
}
开发者ID:mygamelife,项目名称:MockList,代码行数:27,代码来源:mock_List.c

示例4: system_init

void* system_init(void* base_address, uint32_t type_size)
{
  UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM;
  UNITY_SET_DETAIL(CMockString_system_init);
  CMOCK_system_init_CALL_INSTANCE* cmock_call_instance = (CMOCK_system_init_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.system_init_CallInstance);
  Mock.system_init_CallInstance = CMock_Guts_MemNext(Mock.system_init_CallInstance);
  UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringCalledMore);
  cmock_line = cmock_call_instance->LineNumber;
  {
    UNITY_SET_DETAILS(CMockString_system_init,CMockString_base_address);
    if (cmock_call_instance->Expected_base_address == NULL)
      { UNITY_TEST_ASSERT_NULL(base_address, cmock_line, CMockStringExpNULL); }
    else
      {
          // Autogenerated mock tests equality of data.
          // We are using specific HW addresses, just test addresses.
          UNITY_TEST_ASSERT_EQUAL_HEX32(
            cmock_call_instance->Expected_base_address,
            base_address,
            cmock_line,
            CMockStringMismatch);
      }
  }
  {
    UNITY_SET_DETAILS(CMockString_system_init,CMockString_type_size);
    UNITY_TEST_ASSERT_EQUAL_HEX32(cmock_call_instance->Expected_type_size, type_size, cmock_line, CMockStringMismatch);
  }
  UNITY_CLR_DETAILS();
  return cmock_call_instance->ReturnVal;
}
开发者ID:BookProjects,项目名称:main_project,代码行数:30,代码来源:mock_system_memory_internals.c

示例5: stringRightTrim

void stringRightTrim(String* string)
{
  UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM;
  CMOCK_stringRightTrim_CALL_INSTANCE* cmock_call_instance = (CMOCK_stringRightTrim_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.stringRightTrim_CallInstance);
  Mock.stringRightTrim_CallInstance = CMock_Guts_MemNext(Mock.stringRightTrim_CallInstance);
  if (Mock.stringRightTrim_IgnoreBool)
  {
    return;
  }
  if (Mock.stringRightTrim_CallbackFunctionPointer != NULL)
  {
    Mock.stringRightTrim_CallbackFunctionPointer(string, Mock.stringRightTrim_CallbackCalls++);
    return;
  }
  UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "Function 'stringRightTrim' called more times than expected.");
  cmock_line = cmock_call_instance->LineNumber;
  if (cmock_call_instance->CallOrder > ++GlobalVerifyOrder)
    UNITY_TEST_FAIL(cmock_line, "Function 'stringRightTrim' called earlier than expected.");
  if (cmock_call_instance->CallOrder < GlobalVerifyOrder)
    UNITY_TEST_FAIL(cmock_line, "Function 'stringRightTrim' called later than expected.");
  UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(cmock_call_instance->Expected_string), (void*)(string), sizeof(String), cmock_line, "Function 'stringRightTrim' called with unexpected value for argument 'string'.");
  if (cmock_call_instance->ExceptionToThrow != CEXCEPTION_NONE)
  {
    Throw(cmock_call_instance->ExceptionToThrow);
  }
}
开发者ID:jasonchuah93,项目名称:LatestShuntingYard,代码行数:26,代码来源:mock_StringObject.c

示例6: stringCopy

void stringCopy(char* source, char* destination, int startLocation, int length)
{
  UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM;
  CMOCK_stringCopy_CALL_INSTANCE* cmock_call_instance = (CMOCK_stringCopy_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.stringCopy_CallInstance);
  Mock.stringCopy_CallInstance = CMock_Guts_MemNext(Mock.stringCopy_CallInstance);
  if (Mock.stringCopy_IgnoreBool)
  {
    return;
  }
  if (Mock.stringCopy_CallbackFunctionPointer != NULL)
  {
    Mock.stringCopy_CallbackFunctionPointer(source, destination, startLocation, length, Mock.stringCopy_CallbackCalls++);
    return;
  }
  UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "Function 'stringCopy' called more times than expected.");
  cmock_line = cmock_call_instance->LineNumber;
  if (cmock_call_instance->CallOrder > ++GlobalVerifyOrder)
    UNITY_TEST_FAIL(cmock_line, "Function 'stringCopy' called earlier than expected.");
  if (cmock_call_instance->CallOrder < GlobalVerifyOrder)
    UNITY_TEST_FAIL(cmock_line, "Function 'stringCopy' called later than expected.");
  UNITY_TEST_ASSERT_EQUAL_STRING(cmock_call_instance->Expected_source, source, cmock_line, "Function 'stringCopy' called with unexpected value for argument 'source'.");
  UNITY_TEST_ASSERT_EQUAL_STRING(cmock_call_instance->Expected_destination, destination, cmock_line, "Function 'stringCopy' called with unexpected value for argument 'destination'.");
  UNITY_TEST_ASSERT_EQUAL_INT(cmock_call_instance->Expected_startLocation, startLocation, cmock_line, "Function 'stringCopy' called with unexpected value for argument 'startLocation'.");
  UNITY_TEST_ASSERT_EQUAL_INT(cmock_call_instance->Expected_length, length, cmock_line, "Function 'stringCopy' called with unexpected value for argument 'length'.");
  if (cmock_call_instance->ExceptionToThrow != CEXCEPTION_NONE)
  {
    Throw(cmock_call_instance->ExceptionToThrow);
  }
}
开发者ID:jasonchuah93,项目名称:LatestShuntingYard,代码行数:29,代码来源:mock_StringObject.c

示例7: Stack_create

Stack* Stack_create(void)
{
  UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM;
  CMOCK_Stack_create_CALL_INSTANCE* cmock_call_instance = (CMOCK_Stack_create_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.Stack_create_CallInstance);
  Mock.Stack_create_CallInstance = CMock_Guts_MemNext(Mock.Stack_create_CallInstance);
  if (Mock.Stack_create_IgnoreBool)
  {
    if (cmock_call_instance == NULL)
      return Mock.Stack_create_FinalReturn;
    Mock.Stack_create_FinalReturn = cmock_call_instance->ReturnVal;
    return cmock_call_instance->ReturnVal;
  }
  if (Mock.Stack_create_CallbackFunctionPointer != NULL)
  {
    return Mock.Stack_create_CallbackFunctionPointer(Mock.Stack_create_CallbackCalls++);
  }
  UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "Function 'Stack_create' called more times than expected.");
  cmock_line = cmock_call_instance->LineNumber;
  if (cmock_call_instance->CallOrder > ++GlobalVerifyOrder)
    UNITY_TEST_FAIL(cmock_line, "Function 'Stack_create' called earlier than expected.");
  if (cmock_call_instance->CallOrder < GlobalVerifyOrder)
    UNITY_TEST_FAIL(cmock_line, "Function 'Stack_create' called later than expected.");
  if (cmock_call_instance->ExceptionToThrow != CEXCEPTION_NONE)
  {
    Throw(cmock_call_instance->ExceptionToThrow);
  }
  return cmock_call_instance->ReturnVal;
}
开发者ID:Raydivine,项目名称:Insitution,代码行数:28,代码来源:mock_Stack.c

示例8: qeo_security_policy_get_fine_grained_rules

qeo_retcode_t qeo_security_policy_get_fine_grained_rules(qeo_security_policy_hndl qeoSecPol, uintptr_t cookie, const char* topic_name, unsigned int selector_mask, qeo_security_policy_update_fine_grained_rules_cb update_cb)
{
    UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM;
    CMOCK_qeo_security_policy_get_fine_grained_rules_CALL_INSTANCE* cmock_call_instance = (CMOCK_qeo_security_policy_get_fine_grained_rules_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.qeo_security_policy_get_fine_grained_rules_CallInstance);
    Mock.qeo_security_policy_get_fine_grained_rules_CallInstance = CMock_Guts_MemNext(Mock.qeo_security_policy_get_fine_grained_rules_CallInstance);
    if (Mock.qeo_security_policy_get_fine_grained_rules_IgnoreBool)
    {
        if (cmock_call_instance == NULL)
            return Mock.qeo_security_policy_get_fine_grained_rules_FinalReturn;
        memcpy(&Mock.qeo_security_policy_get_fine_grained_rules_FinalReturn, &cmock_call_instance->ReturnVal, sizeof(qeo_retcode_t));
        return cmock_call_instance->ReturnVal;
    }
    if (Mock.qeo_security_policy_get_fine_grained_rules_CallbackFunctionPointer != NULL)
    {
        return Mock.qeo_security_policy_get_fine_grained_rules_CallbackFunctionPointer(qeoSecPol, cookie, topic_name, selector_mask, update_cb, Mock.qeo_security_policy_get_fine_grained_rules_CallbackCalls++);
    }
    UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "Function 'qeo_security_policy_get_fine_grained_rules' called more times than expected.");
    cmock_line = cmock_call_instance->LineNumber;
    UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(&cmock_call_instance->Expected_qeoSecPol), (void*)(&qeoSecPol), sizeof(qeo_security_policy_hndl), cmock_line, "Function 'qeo_security_policy_get_fine_grained_rules' called with unexpected value for argument 'qeoSecPol'.");
    UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(&cmock_call_instance->Expected_cookie), (void*)(&cookie), sizeof(uintptr_t), cmock_line, "Function 'qeo_security_policy_get_fine_grained_rules' called with unexpected value for argument 'cookie'.");
    if (cmock_call_instance->Expected_topic_name == NULL)
    {
        UNITY_TEST_ASSERT_NULL(topic_name, cmock_line, "Expected NULL. Function 'qeo_security_policy_get_fine_grained_rules' called with unexpected value for argument 'topic_name'.");
    }
    else
    {
        UNITY_TEST_ASSERT_EQUAL_INT8_ARRAY(cmock_call_instance->Expected_topic_name, topic_name, 1, cmock_line, "Function 'qeo_security_policy_get_fine_grained_rules' called with unexpected value for argument 'topic_name'.");
    }
    UNITY_TEST_ASSERT_EQUAL_HEX32(cmock_call_instance->Expected_selector_mask, selector_mask, cmock_line, "Function 'qeo_security_policy_get_fine_grained_rules' called with unexpected value for argument 'selector_mask'.");
    UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(&cmock_call_instance->Expected_update_cb), (void*)(&update_cb), sizeof(qeo_security_policy_update_fine_grained_rules_cb), cmock_line, "Function 'qeo_security_policy_get_fine_grained_rules' called with unexpected value for argument 'update_cb'.");
    return cmock_call_instance->ReturnVal;
}
开发者ID:wjwwood,项目名称:tinq-core,代码行数:32,代码来源:Mockpolicy.c

示例9: stringCreate

String* stringCreate(char* expression)
{
  UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM;
  CMOCK_stringCreate_CALL_INSTANCE* cmock_call_instance = (CMOCK_stringCreate_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.stringCreate_CallInstance);
  Mock.stringCreate_CallInstance = CMock_Guts_MemNext(Mock.stringCreate_CallInstance);
  if (Mock.stringCreate_IgnoreBool)
  {
    if (cmock_call_instance == NULL)
      return Mock.stringCreate_FinalReturn;
    Mock.stringCreate_FinalReturn = cmock_call_instance->ReturnVal;
    return cmock_call_instance->ReturnVal;
  }
  if (Mock.stringCreate_CallbackFunctionPointer != NULL)
  {
    return Mock.stringCreate_CallbackFunctionPointer(expression, Mock.stringCreate_CallbackCalls++);
  }
  UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "Function 'stringCreate' called more times than expected.");
  cmock_line = cmock_call_instance->LineNumber;
  if (cmock_call_instance->CallOrder > ++GlobalVerifyOrder)
    UNITY_TEST_FAIL(cmock_line, "Function 'stringCreate' called earlier than expected.");
  if (cmock_call_instance->CallOrder < GlobalVerifyOrder)
    UNITY_TEST_FAIL(cmock_line, "Function 'stringCreate' called later than expected.");
  UNITY_TEST_ASSERT_EQUAL_STRING(cmock_call_instance->Expected_expression, expression, cmock_line, "Function 'stringCreate' called with unexpected value for argument 'expression'.");
  if (cmock_call_instance->ExceptionToThrow != CEXCEPTION_NONE)
  {
    Throw(cmock_call_instance->ExceptionToThrow);
  }
  return cmock_call_instance->ReturnVal;
}
开发者ID:jasonchuah93,项目名称:LatestShuntingYard,代码行数:29,代码来源:mock_StringObject.c

示例10: getWordAndUpdate

String* getWordAndUpdate(String* line, char* delimiter)
{
  UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM;
  CMOCK_getWordAndUpdate_CALL_INSTANCE* cmock_call_instance = (CMOCK_getWordAndUpdate_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.getWordAndUpdate_CallInstance);
  Mock.getWordAndUpdate_CallInstance = CMock_Guts_MemNext(Mock.getWordAndUpdate_CallInstance);
  if (Mock.getWordAndUpdate_IgnoreBool)
  {
    if (cmock_call_instance == NULL)
      return Mock.getWordAndUpdate_FinalReturn;
    Mock.getWordAndUpdate_FinalReturn = cmock_call_instance->ReturnVal;
    return cmock_call_instance->ReturnVal;
  }
  if (Mock.getWordAndUpdate_CallbackFunctionPointer != NULL)
  {
    return Mock.getWordAndUpdate_CallbackFunctionPointer(line, delimiter, Mock.getWordAndUpdate_CallbackCalls++);
  }
  UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "Function 'getWordAndUpdate' called more times than expected.");
  cmock_line = cmock_call_instance->LineNumber;
  if (cmock_call_instance->CallOrder > ++GlobalVerifyOrder)
    UNITY_TEST_FAIL(cmock_line, "Function 'getWordAndUpdate' called earlier than expected.");
  if (cmock_call_instance->CallOrder < GlobalVerifyOrder)
    UNITY_TEST_FAIL(cmock_line, "Function 'getWordAndUpdate' called later than expected.");
  UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(cmock_call_instance->Expected_line), (void*)(line), sizeof(String), cmock_line, "Function 'getWordAndUpdate' called with unexpected value for argument 'line'.");
  UNITY_TEST_ASSERT_EQUAL_STRING(cmock_call_instance->Expected_delimiter, delimiter, cmock_line, "Function 'getWordAndUpdate' called with unexpected value for argument 'delimiter'.");
  if (cmock_call_instance->ExceptionToThrow != CEXCEPTION_NONE)
  {
    Throw(cmock_call_instance->ExceptionToThrow);
  }
  return cmock_call_instance->ReturnVal;
}
开发者ID:jasonchuah93,项目名称:LatestShuntingYard,代码行数:30,代码来源:mock_StringObject.c

示例11: ListNew

List* ListNew(int length)
{
  UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM;
  CMOCK_ListNew_CALL_INSTANCE* cmock_call_instance = (CMOCK_ListNew_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.ListNew_CallInstance);
  Mock.ListNew_CallInstance = CMock_Guts_MemNext(Mock.ListNew_CallInstance);
  if (Mock.ListNew_IgnoreBool)
  {
    if (cmock_call_instance == NULL)
      return Mock.ListNew_FinalReturn;
    Mock.ListNew_FinalReturn = cmock_call_instance->ReturnVal;
    return cmock_call_instance->ReturnVal;
  }
  if (Mock.ListNew_CallbackFunctionPointer != NULL)
  {
    return Mock.ListNew_CallbackFunctionPointer(length, Mock.ListNew_CallbackCalls++);
  }
  UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "Function 'ListNew' called more times than expected.");
  cmock_line = cmock_call_instance->LineNumber;
  if (cmock_call_instance->CallOrder > ++GlobalVerifyOrder)
    UNITY_TEST_FAIL(cmock_line, "Function 'ListNew' called earlier than expected.");
  if (cmock_call_instance->CallOrder < GlobalVerifyOrder)
    UNITY_TEST_FAIL(cmock_line, "Function 'ListNew' called later than expected.");
  UNITY_TEST_ASSERT_EQUAL_INT(cmock_call_instance->Expected_length, length, cmock_line, "Function 'ListNew' called with unexpected value for argument 'length'.");
  if (cmock_call_instance->ExceptionToThrow != CEXCEPTION_NONE)
  {
    Throw(cmock_call_instance->ExceptionToThrow);
  }
  return cmock_call_instance->ReturnVal;
}
开发者ID:mygamelife,项目名称:MockList,代码行数:29,代码来源:mock_List.c

示例12: calculate

Token* calculate(Operator* opeToken, Number* first, Number* second)
{
  UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM;
  CMOCK_calculate_CALL_INSTANCE* cmock_call_instance = (CMOCK_calculate_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.calculate_CallInstance);
  Mock.calculate_CallInstance = CMock_Guts_MemNext(Mock.calculate_CallInstance);
  if (Mock.calculate_IgnoreBool)
  {
    if (cmock_call_instance == NULL)
      return Mock.calculate_FinalReturn;
    Mock.calculate_FinalReturn = cmock_call_instance->ReturnVal;
    return cmock_call_instance->ReturnVal;
  }
  if (Mock.calculate_CallbackFunctionPointer != NULL)
  {
    return Mock.calculate_CallbackFunctionPointer(opeToken, first, second, Mock.calculate_CallbackCalls++);
  }
  UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "Function 'calculate' called more times than expected.");
  cmock_line = cmock_call_instance->LineNumber;
  if (cmock_call_instance->CallOrder > ++GlobalVerifyOrder)
    UNITY_TEST_FAIL(cmock_line, "Function 'calculate' called earlier than expected.");
  if (cmock_call_instance->CallOrder < GlobalVerifyOrder)
    UNITY_TEST_FAIL(cmock_line, "Function 'calculate' called later than expected.");
  UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(cmock_call_instance->Expected_opeToken), (void*)(opeToken), sizeof(Operator), cmock_line, "Function 'calculate' called with unexpected value for argument 'opeToken'.");
  UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(cmock_call_instance->Expected_first), (void*)(first), sizeof(Number), cmock_line, "Function 'calculate' called with unexpected value for argument 'first'.");
  UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(cmock_call_instance->Expected_second), (void*)(second), sizeof(Number), cmock_line, "Function 'calculate' called with unexpected value for argument 'second'.");
  return cmock_call_instance->ReturnVal;
}
开发者ID:jasonchuah93,项目名称:JasonShuntingYard,代码行数:27,代码来源:mock_calculateToken.c

示例13: qeo_platform_get_device_storage_path

qeo_util_retcode_t qeo_platform_get_device_storage_path(const char* file_name, char** full_storage_path)
{
  UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM;
  CMOCK_qeo_platform_get_device_storage_path_CALL_INSTANCE* cmock_call_instance = (CMOCK_qeo_platform_get_device_storage_path_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.qeo_platform_get_device_storage_path_CallInstance);
  Mock.qeo_platform_get_device_storage_path_CallInstance = CMock_Guts_MemNext(Mock.qeo_platform_get_device_storage_path_CallInstance);
  if (Mock.qeo_platform_get_device_storage_path_IgnoreBool)
  {
    if (cmock_call_instance == NULL)
      return Mock.qeo_platform_get_device_storage_path_FinalReturn;
    memcpy(&Mock.qeo_platform_get_device_storage_path_FinalReturn, &cmock_call_instance->ReturnVal, sizeof(qeo_util_retcode_t));
    return cmock_call_instance->ReturnVal;
  }
  if (Mock.qeo_platform_get_device_storage_path_CallbackFunctionPointer != NULL)
  {
    return Mock.qeo_platform_get_device_storage_path_CallbackFunctionPointer(file_name, full_storage_path, Mock.qeo_platform_get_device_storage_path_CallbackCalls++);
  }
  UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "Function 'qeo_platform_get_device_storage_path' called more times than expected.");
  cmock_line = cmock_call_instance->LineNumber;
  UNITY_TEST_ASSERT_EQUAL_STRING(cmock_call_instance->Expected_file_name, file_name, cmock_line, "Function 'qeo_platform_get_device_storage_path' called with unexpected value for argument 'file_name'.");
  if (cmock_call_instance->Expected_full_storage_path == NULL)
    { UNITY_TEST_ASSERT_NULL(full_storage_path, cmock_line, "Expected NULL. Function 'qeo_platform_get_device_storage_path' called with unexpected value for argument 'full_storage_path'."); }
  else
    { UNITY_TEST_ASSERT_EQUAL_STRING_ARRAY(cmock_call_instance->Expected_full_storage_path, full_storage_path, 1, cmock_line, "Function 'qeo_platform_get_device_storage_path' called with unexpected value for argument 'full_storage_path'."); }
  return cmock_call_instance->ReturnVal;
}
开发者ID:bq,项目名称:qeo-core,代码行数:25,代码来源:Mockplatform.c

示例14: qeo_platform_get_key_value

qeo_util_retcode_t qeo_platform_get_key_value(const char* key, char** value)
{
  UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM;
  CMOCK_qeo_platform_get_key_value_CALL_INSTANCE* cmock_call_instance = (CMOCK_qeo_platform_get_key_value_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.qeo_platform_get_key_value_CallInstance);
  Mock.qeo_platform_get_key_value_CallInstance = CMock_Guts_MemNext(Mock.qeo_platform_get_key_value_CallInstance);
  if (Mock.qeo_platform_get_key_value_IgnoreBool)
  {
    if (cmock_call_instance == NULL)
      return Mock.qeo_platform_get_key_value_FinalReturn;
    memcpy(&Mock.qeo_platform_get_key_value_FinalReturn, &cmock_call_instance->ReturnVal, sizeof(qeo_util_retcode_t));
    return cmock_call_instance->ReturnVal;
  }
  if (Mock.qeo_platform_get_key_value_CallbackFunctionPointer != NULL)
  {
    return Mock.qeo_platform_get_key_value_CallbackFunctionPointer(key, value, Mock.qeo_platform_get_key_value_CallbackCalls++);
  }
  UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "Function 'qeo_platform_get_key_value' called more times than expected.");
  cmock_line = cmock_call_instance->LineNumber;
  UNITY_TEST_ASSERT_EQUAL_STRING(cmock_call_instance->Expected_key, key, cmock_line, "Function 'qeo_platform_get_key_value' called with unexpected value for argument 'key'.");
  if (cmock_call_instance->Expected_value == NULL)
    { UNITY_TEST_ASSERT_NULL(value, cmock_line, "Expected NULL. Function 'qeo_platform_get_key_value' called with unexpected value for argument 'value'."); }
  else
    { UNITY_TEST_ASSERT_EQUAL_STRING_ARRAY(cmock_call_instance->Expected_value, value, 1, cmock_line, "Function 'qeo_platform_get_key_value' called with unexpected value for argument 'value'."); }
  return cmock_call_instance->ReturnVal;
}
开发者ID:bq,项目名称:qeo-core,代码行数:25,代码来源:Mockplatform.c

示例15: isNumber

int isNumber(Token* unknownToken)
{
  UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM;
  CMOCK_isNumber_CALL_INSTANCE* cmock_call_instance = (CMOCK_isNumber_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.isNumber_CallInstance);
  Mock.isNumber_CallInstance = CMock_Guts_MemNext(Mock.isNumber_CallInstance);
  if (Mock.isNumber_IgnoreBool)
  {
    if (cmock_call_instance == NULL)
      return Mock.isNumber_FinalReturn;
    Mock.isNumber_FinalReturn = cmock_call_instance->ReturnVal;
    return cmock_call_instance->ReturnVal;
  }
  if (Mock.isNumber_CallbackFunctionPointer != NULL)
  {
    return Mock.isNumber_CallbackFunctionPointer(unknownToken, Mock.isNumber_CallbackCalls++);
  }
  UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "Function 'isNumber' called more times than expected.");
  cmock_line = cmock_call_instance->LineNumber;
  if (cmock_call_instance->CallOrder > ++GlobalVerifyOrder)
    UNITY_TEST_FAIL(cmock_line, "Function 'isNumber' called earlier than expected.");
  if (cmock_call_instance->CallOrder < GlobalVerifyOrder)
    UNITY_TEST_FAIL(cmock_line, "Function 'isNumber' called later than expected.");
  UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(cmock_call_instance->Expected_unknownToken), (void*)(unknownToken), sizeof(Token), cmock_line, "Function 'isNumber' called with unexpected value for argument 'unknownToken'.");
  if (cmock_call_instance->ExceptionToThrow != CEXCEPTION_NONE)
  {
    Throw(cmock_call_instance->ExceptionToThrow);
  }
  return cmock_call_instance->ReturnVal;
}
开发者ID:jasonchuah93,项目名称:Calculator,代码行数:29,代码来源:mock_nextToken.c


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