|
void | closeAndDeleteDB () |
| Cleanup function to close and delete the database. More...
|
|
bool | createLegacyDatabase () |
| Function to create legacy database. More...
|
|
bool | insertEntryLegacy (const std::string &uuid, const std::string &mac) |
| Insert Entry for legacy database. More...
|
|
bool | setupDatabase (bool migratedDatabase) |
|
void | getOrderedMacHelper (bool ascending) |
|
void | getRowsHelper (std::function< bool(SQLiteBluetoothStorage &, std::unordered_map< std::string, std::string > *)> retrieveRows, const std::unordered_map< std::string, std::string > &macToUuids, const std::unordered_map< std::string, std::string > &expected) |
|
void | getRetrieveValueHelper (std::function< bool(SQLiteBluetoothStorage &, const std::string &, std::string *)> retrieveValue, const std::string &key, const std::string &expectedValue, const std::unordered_map< std::string, std::string > &macToUuids) |
|
| Test () |
|
◆ closeAndDeleteDB()
void alexaClientSDK::acsdkBluetooth::test::SQLiteBluetoothStorageTest::closeAndDeleteDB |
( |
| ) |
|
|
protected |
Cleanup function to close and delete the database.
◆ createLegacyDatabase()
bool alexaClientSDK::acsdkBluetooth::test::SQLiteBluetoothStorageTest::createLegacyDatabase |
( |
| ) |
|
|
protected |
Function to create legacy database.
◆ getOrderedMacHelper()
void alexaClientSDK::acsdkBluetooth::test::SQLiteBluetoothStorageTest::getOrderedMacHelper |
( |
bool |
ascending | ) |
|
|
protected |
Helper function that abstracts the test logic for getOrderedMac teste cases.
- Parameters
-
ascending | Whether we're testing the ascending or descending case. |
◆ getRetrieveValueHelper()
void alexaClientSDK::acsdkBluetooth::test::SQLiteBluetoothStorageTest::getRetrieveValueHelper |
( |
std::function< bool(SQLiteBluetoothStorage &, const std::string &, std::string *)> |
retrieveValue, |
|
|
const std::string & |
key, |
|
|
const std::string & |
expectedValue, |
|
|
const std::unordered_map< std::string, std::string > & |
macToUuids |
|
) |
| |
|
protected |
Helper function that abstracts the logic for insertByMac given a macToUuids map and verifies the expected value with the one returned by the retrieveValue function.
- Parameters
-
retrieveValue | function to retrieve value from database (getMac/getUuid/getCategory). |
key | The key (either the mac or uuid). |
expectedValue | The expected value from the given retrieveValue function call. |
macToUuids | A map of macToUuids to initialize the database with. |
◆ getRowsHelper()
void alexaClientSDK::acsdkBluetooth::test::SQLiteBluetoothStorageTest::getRowsHelper |
( |
std::function< bool(SQLiteBluetoothStorage &, std::unordered_map< std::string, std::string > *)> |
retrieveRows, |
|
|
const std::unordered_map< std::string, std::string > & |
macToUuids, |
|
|
const std::unordered_map< std::string, std::string > & |
expected |
|
) |
| |
|
protected |
Helper function that abstracts the logic for getMacToUuid and getUuidToMac test cases.
- Parameters
-
retrieveRows | Either the getMacToUuid or getUuidToMac function. |
macToUuids | A map of macToUuids to initialize the database with. |
expected | The expected results. |
◆ insertEntryLegacy()
bool alexaClientSDK::acsdkBluetooth::test::SQLiteBluetoothStorageTest::insertEntryLegacy |
( |
const std::string & |
uuid, |
|
|
const std::string & |
mac |
|
) |
| |
|
protected |
Insert Entry for legacy database.
◆ SetUp()
void alexaClientSDK::acsdkBluetooth::test::SQLiteBluetoothStorageTest::SetUp |
( |
| ) |
|
|
virtual |
◆ setupDatabase()
bool alexaClientSDK::acsdkBluetooth::test::SQLiteBluetoothStorageTest::setupDatabase |
( |
bool |
migratedDatabase | ) |
|
|
protected |
Helper function to setup database.
- Parameters
-
migrated | Whether using migrated database. |
- Returns
- bool Whether database setup successful.
◆ TearDown()
void alexaClientSDK::acsdkBluetooth::test::SQLiteBluetoothStorageTest::TearDown |
( |
| ) |
|
|
virtual |
◆ m_db
std::unique_ptr<SQLiteBluetoothStorage> alexaClientSDK::acsdkBluetooth::test::SQLiteBluetoothStorageTest::m_db |
|
protected |
The database instance. Protected because it needs to be accessed in test cases.
◆ m_sqLiteDb
The documentation for this class was generated from the following file:
AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Licensed under the Apache License, Version 2.0