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

Function testSetSamplerPortEmitsCommand

tests/transmit_model_apd_test.cpp:66–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64}
65
66void testSetSamplerPortEmitsCommand()
67{
68 TransmitModel tx;
69 QSignalSpy cmds(&tx, &TransmitModel::commandReady);
70
71 tx.setApdSamplerPort("ANT2", "RX_B");
72 report("setApdSamplerPort emits one command", cmds.count() == 1);
73 report("command formatted correctly",
74 cmds.first().first().toString() == "apd sampler tx_ant=ANT2 sample_port=RX_B");
75
76 // Lowercase input is normalised to uppercase to match the radio's case.
77 tx.setApdSamplerPort("xvta", "internal");
78 report("sampler command upcases ant and port",
79 cmds.last().first().toString() == "apd sampler tx_ant=XVTA sample_port=INTERNAL");
80
81 // Empty inputs are ignored — no spurious command.
82 int before = cmds.count();
83 tx.setApdSamplerPort("", "RX_A");
84 tx.setApdSamplerPort("ANT1", "");
85 report("empty txAnt or port silently dropped", cmds.count() == before);
86}
87
88void testResetEqualizerEmitsCommand()
89{

Callers 1

mainFunction · 0.85

Calls 4

setApdSamplerPortMethod · 0.80
countMethod · 0.80
reportFunction · 0.70
toStringMethod · 0.45

Tested by

no test coverage detected