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

Function main

tests/device_diagnostics_test.cpp:36–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34} // namespace
35
36int main()
37{
38 std::printf("Device diagnostics tests\n\n");
39
40 expectBus("USB from device name",
41 QStringLiteral("USB Audio CODEC"),
42 QByteArray(),
43 QStringLiteral("USB"));
44 expectBus("USB from opaque id",
45 QStringLiteral("External Speaker"),
46 QByteArray("swdevice\\mmdevapi\\usb#vid_1234&pid_abcd"),
47 QStringLiteral("USB"));
48 expectBus("Bluetooth from device name",
49 QStringLiteral("AirPods Pro"),
50 QByteArray(),
51 QStringLiteral("Bluetooth"));
52 expectBus("Bluetooth from BT token",
53 QStringLiteral("JBL BT Speaker"),
54 QByteArray(),
55 QStringLiteral("Bluetooth"));
56 expectBus("Bluetooth from id",
57 QStringLiteral("Headphones"),
58 QByteArray("BTHENUM\\Dev_123456"),
59 QStringLiteral("Bluetooth"));
60 expectBus("Unknown when Qt gives no transport hint",
61 QStringLiteral("Built-in Output"),
62 QByteArray("coreaudio-default-output"),
63 QStringLiteral("Unknown"));
64
65 std::printf("\n%s\n", g_failed == 0 ? "All tests passed." : "Some tests failed.");
66 return g_failed == 0 ? 0 : 1;
67}

Callers

nothing calls this directly

Calls 1

expectBusFunction · 0.85

Tested by

no test coverage detected