Skip to content

Commit

Permalink
Revert "Updates to allow stub override nasa#832"
Browse files Browse the repository at this point in the history
This reverts commit 2d6801f.
Should not have committed to my main branch.
Made a different branch, moved changes there.
Will merge to my main later.
  • Loading branch information
asgibson committed Feb 26, 2021
1 parent 2d6801f commit 5053245
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 35 deletions.
21 changes: 0 additions & 21 deletions ut_assert/inc/utstubs.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,6 @@ typedef int32 (*UT_VaHookFunc_t)(void *UserObj, int32 StubRetcode, uint32 CallCo
*/
void UT_ResetState(UT_EntryKey_t FuncKey);

/**
* A value to indicate if the currently running stub's behavior after
* a hook call should be run or not.
*
* \param Retcode The boolean value indicating the override. When 'true'
* indicates remaining stub code should not be run, it is in override.
*/
bool UT_StubIsOveridden(void);

/**
* Add a deferred return code entry for the given stub function
*
Expand Down Expand Up @@ -248,18 +239,6 @@ void UT_ClearForceFail(UT_EntryKey_t FuncKey);
*/
void UT_SetHookFunction(UT_EntryKey_t FuncKey, UT_HookFunc_t HookFunc, void *UserObj);

/**
* Set a Hook function for a particular call, but override any remaining stub functionality
*
* This triggers a callback to a user-defined function when the stub is invoked.
* Upon return to the original stub the OverrideStub will be true and any remaining
* code lines in stub (that are purposefully bypassed by the stub) will not be executed.
*
* \param FuncKey The stub function to add the hook to.
* \param HookFunc User defined hook function. Set NULL to delete/clear an entry.
* \param UserObj Arbitrary user data object to pass to the hook function
*/void UT_SetHookOverrideStubFunction(UT_EntryKey_t FuncKey, UT_HookFunc_t HookFunc, void *UserObj);

/**
* Set a variable-argument Hook function for a particular call
*
Expand Down
14 changes: 0 additions & 14 deletions ut_assert/src/utstubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ typedef struct

static UT_StubTableEntry_t UT_StubTable[UT_MAX_FUNC_STUBS] = {{0}};
static uint32 UT_MaxStubSearchLen = 0;
static bool StubIsOveridden = false;

/**
* Helper function to clear an entry in the stub table.
Expand Down Expand Up @@ -202,8 +201,6 @@ void UT_ResetState(UT_EntryKey_t FuncKey)
{
UT_MaxStubSearchLen = 0;
}

StubIsOveridden = false; /* Override is ONLY on demand */
}

void UT_Stub_CallOnce(void (*Func)(void))
Expand Down Expand Up @@ -605,12 +602,6 @@ void UT_SetHookFunction(UT_EntryKey_t FuncKey, UT_HookFunc_t HookFunc, void *Use
UT_DoSetHookFunction(FuncKey, Value, UserObj, false);
}

void UT_SetHookOverrideStubFunction(UT_EntryKey_t FuncKey, UT_HookFunc_t HookFunc, void *UserObj)
{
StubIsOveridden = true;
UT_SetHookFunction(FuncKey, HookFunc, UserObj);
}

void UT_SetVaHookFunction(UT_EntryKey_t FuncKey, UT_VaHookFunc_t HookFunc, void *UserObj)
{
UT_HookFuncPtr_t Value;
Expand Down Expand Up @@ -862,8 +853,3 @@ int32 UT_DefaultStubImpl(const char *FunctionName, UT_EntryKey_t FuncKey, int32

return Retcode;
}

bool UT_StubIsOveridden()
{
return StubIsOveridden;
}

0 comments on commit 5053245

Please sign in to comment.