Compare commits
No commits in common. "e6d3612d4da66f77228bafe888983913271593f9" and "13eca24d04f33cb6bdbac4d37cbd63fce6165448" have entirely different histories.
e6d3612d4d
...
13eca24d04
2 changed files with 2 additions and 106 deletions
|
|
@ -6,7 +6,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "CppUTest/CommandLineTestRunner.h"
|
#include "CppUTest/CommandLineTestRunner.h"
|
||||||
#include "CppUTest/UtestMacros.h"
|
|
||||||
#include "CppUTestExt/MockSupport.h"
|
#include "CppUTestExt/MockSupport.h"
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
|
|
@ -22,12 +21,6 @@ TEST_GROUP(test_MockRegEdit){
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
TEST(test_MockRegEdit, confirmgroup)
|
|
||||||
{
|
|
||||||
CHECK_TRUE(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
TEST(test_MockRegEdit, RegEdit_ClearRegisterExpectedCallPasses)
|
TEST(test_MockRegEdit, RegEdit_ClearRegisterExpectedCallPasses)
|
||||||
{
|
{
|
||||||
uint8_t a;
|
uint8_t a;
|
||||||
|
|
@ -136,100 +129,3 @@ TEST(test_MockRegEdit, RegEdit_ReadRegPasses)
|
||||||
|
|
||||||
mock().checkExpectations();
|
mock().checkExpectations();
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
TEST_GROUP(tg_mockregedit_u8){
|
|
||||||
uint8_t fake_reg;
|
|
||||||
uint8_t *reg_ptr;
|
|
||||||
uint8_t num;
|
|
||||||
void setup()
|
|
||||||
{
|
|
||||||
fake_reg = 0;
|
|
||||||
reg_ptr = &fake_reg;
|
|
||||||
num = 0;
|
|
||||||
}
|
|
||||||
void teardown()
|
|
||||||
{
|
|
||||||
mock().checkExpectations();
|
|
||||||
mock().clear();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
TEST(tg_mockregedit_u8, setregistercalled)
|
|
||||||
{
|
|
||||||
mock().expectOneCall("RegEdit_u8_SetRegister").withPointerParameter("reg", reg_ptr);
|
|
||||||
|
|
||||||
RegEdit_u8_SetRegister(reg_ptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST(tg_mockregedit_u8, clearregistercalled)
|
|
||||||
{
|
|
||||||
mock().expectOneCall("RegEdit_u8_ClearRegister").withPointerParameter("reg", reg_ptr);
|
|
||||||
|
|
||||||
RegEdit_u8_ClearRegister(reg_ptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST(tg_mockregedit_u8, setbitcalled)
|
|
||||||
{
|
|
||||||
uint8_t num = 0;
|
|
||||||
|
|
||||||
mock().expectOneCall("RegEdit_u8_SetBit")
|
|
||||||
.withPointerParameter("reg", reg_ptr)
|
|
||||||
.withUnsignedIntParameter("bit_num", num);
|
|
||||||
|
|
||||||
RegEdit_u8_SetBit(reg_ptr, num);
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST(tg_mockregedit_u8, clearbitcalled)
|
|
||||||
{
|
|
||||||
mock().expectOneCall("RegEdit_u8_ClearBit")
|
|
||||||
.withPointerParameter("reg", reg_ptr)
|
|
||||||
.withUnsignedIntParameter("bit_num", num);
|
|
||||||
|
|
||||||
RegEdit_u8_ClearBit(reg_ptr, num);
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST(tg_mockregedit_u8, isbitsetcalled)
|
|
||||||
{
|
|
||||||
mock().expectOneCall("RegEdit_u8_IsBitSet")
|
|
||||||
.withPointerParameter("reg", reg_ptr)
|
|
||||||
.withUnsignedIntParameter("bit_num", num);
|
|
||||||
|
|
||||||
RegEdit_u8_IsBitSet(reg_ptr, num);
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST(tg_mockregedit_u8, logicalornum)
|
|
||||||
{
|
|
||||||
mock().expectOneCall("RegEdit_u8_OR_Num")
|
|
||||||
.withPointerParameter("reg", reg_ptr)
|
|
||||||
.withUnsignedIntParameter("num", num);
|
|
||||||
|
|
||||||
RegEdit_u8_OR_Num(reg_ptr, num);
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST(tg_mockregedit_u8, logicalandnum)
|
|
||||||
{
|
|
||||||
mock().expectOneCall("RegEdit_u8_AND_Num")
|
|
||||||
.withPointerParameter("reg", reg_ptr)
|
|
||||||
.withUnsignedIntParameter("num", num);
|
|
||||||
|
|
||||||
RegEdit_u8_AND_Num(reg_ptr, num);
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST(tg_mockregedit_u8, setnumcalled)
|
|
||||||
{
|
|
||||||
mock().expectOneCall("RegEdit_u8_SetNum")
|
|
||||||
.withPointerParameter("reg", reg_ptr)
|
|
||||||
.withUnsignedIntParameter("num", num);
|
|
||||||
|
|
||||||
RegEdit_u8_SetNum(reg_ptr, num);
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST(tg_mockregedit_u8, readregcalled)
|
|
||||||
{
|
|
||||||
mock().expectOneCall("RegEdit_u8_ReadReg")
|
|
||||||
.withPointerParameter("reg", reg_ptr);
|
|
||||||
|
|
||||||
RegEdit_u8_ReadReg(reg_ptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
/**
|
/**
|
||||||
* @brief Mock of the RegEdit module.
|
* @brief Mock of the RegEdit module.
|
||||||
* @details This file is just re-exports the RegEdit functions plus extras.
|
* @details This file is just re-exports the RegEdit functions plus extras.
|
||||||
* @author Jake G
|
* @author Jake G
|
||||||
* @date 2025-12-21
|
* @date 2025-12-21
|
||||||
* @copyright None
|
* @copyright None
|
||||||
* @file MockRegEdit.h
|
* @file MockRegEdit.h
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue