MCPcopy Create free account
hub / github.com/aethersdr/AetherSDR / testActiveTxSliceSelectsCompPeak

Function testActiveTxSliceSelectsCompPeak

tests/meter_model_test.cpp:106–130  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104}
105
106void testActiveTxSliceSelectsCompPeak()
107{
108 MeterModel model;
109 model.defineMeter(slcMeter(15, 0));
110 model.defineMeter(txMeter(23, "COMPPEAK", "dB", 8));
111 model.defineMeter(slcMeter(37, 1));
112 model.defineMeter(txMeter(45, "COMPPEAK", "dB", 9));
113
114 model.setActiveTxSlice(0);
115 model.updateValues({23}, {rawDb(12.0f)});
116 report("active TX slice 0 uses its COMPPEAK meter",
117 model.hasCompressionMeterValue() && nearlyEqual(model.compPeak(), 12.0f));
118
119 model.updateValues({45}, {rawDb(20.0f)});
120 report("inactive COMPPEAK meter is ignored",
121 model.hasCompressionMeterValue() && nearlyEqual(model.compPeak(), 12.0f));
122
123 model.setActiveTxSlice(1);
124 report("changing active TX slice clears stale compression",
125 !model.hasCompressionMeterValue() && nearlyEqual(model.compPeak(), 0.0f));
126
127 model.updateValues({45}, {rawDb(20.0f)});
128 report("active TX slice 1 uses its COMPPEAK meter",
129 model.hasCompressionMeterValue() && nearlyEqual(model.compPeak(), 20.0f));
130}
131
132void testZeroSourceCompPeakUsesSliceContext()
133{

Callers 1

mainFunction · 0.85

Calls 10

slcMeterFunction · 0.85
txMeterFunction · 0.85
rawDbFunction · 0.85
defineMeterMethod · 0.80
setActiveTxSliceMethod · 0.80
updateValuesMethod · 0.80
compPeakMethod · 0.80
reportFunction · 0.70
nearlyEqualFunction · 0.70

Tested by

no test coverage detected