mirror of https://github.com/rusefi/wideband.git
dc sampler test
This commit is contained in:
parent
49734dec08
commit
1897917dd7
|
@ -14,7 +14,22 @@ int GetESRSupplyR()
|
|||
return 22000;
|
||||
}
|
||||
|
||||
TEST(Sampler, Basic)
|
||||
TEST(Sampler, TestDcBehavior)
|
||||
{
|
||||
Sampler dut;
|
||||
|
||||
AnalogChannelResult data;
|
||||
data.NernstVoltage = 0.45f;
|
||||
data.PumpCurrentVoltage = 1.75f;
|
||||
constexpr float virtualGroundVoltage = 1.65f;
|
||||
|
||||
for (size_t i = 0; i < 10; i++)
|
||||
{
|
||||
dut.ApplySample(data, virtualGroundVoltage);
|
||||
}
|
||||
|
||||
// not exactly 0 because of filtering
|
||||
EXPECT_NEAR(0, dut.GetNernstAc(), 1e-3);
|
||||
EXPECT_FLOAT_EQ(0.45f, dut.GetNernstDc());
|
||||
EXPECT_NEAR(-0.0295, dut.GetPumpNominalCurrent(), 1e-3);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue