mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
import: turn C-string in device_data_t into std::strings
It was never clear what was a pointer to a static string from libdivecomputer and what was allocated. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
0915c1ce43
commit
01306224ff
15 changed files with 120 additions and 129 deletions
|
@ -26,16 +26,16 @@ void TestHelper::recognizeBtAddress()
|
|||
void TestHelper::parseNameAddress()
|
||||
{
|
||||
QString name, address;
|
||||
address = extractBluetoothNameAddress("01:a2:b3:c4:d5:06", name);
|
||||
std::tie(address, name) = extractBluetoothNameAddress("01:a2:b3:c4:d5:06");
|
||||
QCOMPARE(address, QString("01:a2:b3:c4:d5:06"));
|
||||
QCOMPARE(name, QString());
|
||||
address = extractBluetoothNameAddress("somename (01:a2:b3:c4:d5:06)", name);
|
||||
std::tie(address, name) = extractBluetoothNameAddress("somename (01:a2:b3:c4:d5:06)");
|
||||
QCOMPARE(address, QString("01:a2:b3:c4:d5:06"));
|
||||
QCOMPARE(name, QString("somename"));
|
||||
address = extractBluetoothNameAddress("garbage", name);
|
||||
std::tie(address, name) = extractBluetoothNameAddress("garbage");
|
||||
QCOMPARE(address, QString());
|
||||
QCOMPARE(name, QString());
|
||||
address = extractBluetoothNameAddress("somename (LE:{6e50ff5d-cdd3-4c43-a80a-1ed4c7d2d2a5})", name);
|
||||
std::tie(address, name) = extractBluetoothNameAddress("somename (LE:{6e50ff5d-cdd3-4c43-a80a-1ed4c7d2d2a5})");
|
||||
QCOMPARE(address, QString("LE:{6e50ff5d-cdd3-4c43-a80a-1ed4c7d2d2a5}"));
|
||||
QCOMPARE(name, QString("somename"));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue