AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Classes | Namespaces | Functions | Variables
SQLiteBluetoothStorageTest.cpp File Reference
#include <fstream>
#include <functional>
#include <list>
#include <memory>
#include <sstream>
#include <unordered_map>
#include <vector>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <AVSCommon/Utils/Configuration/ConfigurationNode.h>
#include "acsdkBluetooth/SQLiteBluetoothStorage.h"
Include dependency graph for SQLiteBluetoothStorageTest.cpp:

Classes

class  alexaClientSDK::acsdkBluetooth::test::SQLiteBluetoothStorageTest
 
class  alexaClientSDK::acsdkBluetooth::test::SQLiteBluetoothStorageParameterizedTests
 Parameterized tests to test both migrated and newly created databases. More...
 

Namespaces

 alexaClientSDK
 Whether or not curl logs should be emitted.
 
 alexaClientSDK::acsdkBluetooth
 
 alexaClientSDK::acsdkBluetooth::test
 

Functions

static bool alexaClientSDK::acsdkBluetooth::test::fileExists (const std::string &file)
 
 alexaClientSDK::acsdkBluetooth::test::TEST_F (SQLiteBluetoothStorageTest, uninitializedDatabase)
 Test database not created yet, open should fail. More...
 
 alexaClientSDK::acsdkBluetooth::test::TEST_F (SQLiteBluetoothStorageTest, openDatabase)
 Test if 2.0 database already created, open should succeed. More...
 
 alexaClientSDK::acsdkBluetooth::test::TEST_F (SQLiteBluetoothStorageTest, openLegacyDatabase)
 Test if 1.0 database already created, open should succeed. More...
 
 alexaClientSDK::acsdkBluetooth::test::TEST_F (SQLiteBluetoothStorageTest, retrieveCategoryforUnknownUUID)
 Test retrieving category for a UUID that does not exist after database migration. More...
 
 alexaClientSDK::acsdkBluetooth::test::TEST_F (SQLiteBluetoothStorageTest, insertByMacPostDatabaseUpgrade)
 Test insertByMac after database migration. More...
 
 alexaClientSDK::acsdkBluetooth::test::TEST_F (SQLiteBluetoothStorageTest, retrieveMacforKnownUUID)
 Test retrieving mac for a UUID saved before migration after database migration. More...
 
 alexaClientSDK::acsdkBluetooth::test::TEST_F (SQLiteBluetoothStorageTest, retrieveCategoryforKnownUUID)
 Test retrieving category for a UUID saved before migration after database migration. More...
 
 alexaClientSDK::acsdkBluetooth::test::TEST_F (SQLiteBluetoothStorageTest, retrieveCategoryforKnownMultipleUUID)
 Test retrieving category for multiple UUIDs saved before migration after database migration. More...
 
 alexaClientSDK::acsdkBluetooth::test::TEST_F (SQLiteBluetoothStorageTest, testEmptyDatabase)
 Test when a database is empty. More...
 
 alexaClientSDK::acsdkBluetooth::test::INSTANTIATE_TEST_CASE_P (Parameterized, SQLiteBluetoothStorageParameterizedTests, ::testing::Values(true, false))
 
 alexaClientSDK::acsdkBluetooth::test::TEST_P (SQLiteBluetoothStorageParameterizedTests, test_createInvalidConfigurationRoot)
 Tests the create function with an invalid root. More...
 
 alexaClientSDK::acsdkBluetooth::test::TEST_P (SQLiteBluetoothStorageParameterizedTests, test_createValidConfigurationRoot)
 Tests creating a database object. More...
 
 alexaClientSDK::acsdkBluetooth::test::TEST_P (SQLiteBluetoothStorageParameterizedTests, test_createDatabaseSucceeds)
 Test creating a valid DB. This is implicitly tested in the SetUp() function, but we formally test it here. More...
 
 alexaClientSDK::acsdkBluetooth::test::TEST_P (SQLiteBluetoothStorageParameterizedTests, test_createExistingDatabaseFails)
 Test that creating an existing DB fails. More...
 
 alexaClientSDK::acsdkBluetooth::test::TEST_P (SQLiteBluetoothStorageParameterizedTests, test_openExistingDatabaseSucceeds)
 Test opening an existing database. More...
 
 alexaClientSDK::acsdkBluetooth::test::TEST_P (SQLiteBluetoothStorageParameterizedTests, test_clearOnOneRowSucceeds)
 Test clearing the table with one row. More...
 
 alexaClientSDK::acsdkBluetooth::test::TEST_P (SQLiteBluetoothStorageParameterizedTests, test_clearOnMultipleRowsSucceeds)
 Test clearing the table with multiple rows. More...
 
 alexaClientSDK::acsdkBluetooth::test::TEST_P (SQLiteBluetoothStorageParameterizedTests, test_clearOnEmptySucceeds)
 Test clearing the table when it's already empty. More...
 
 alexaClientSDK::acsdkBluetooth::test::TEST_P (SQLiteBluetoothStorageParameterizedTests, test_getUuidWithOneSucceeds)
 Test getUuid with one row containing UUID. More...
 
 alexaClientSDK::acsdkBluetooth::test::TEST_P (SQLiteBluetoothStorageParameterizedTests, test_getUuidWithMultipleSucceeds)
 Test getUuid with multiple rows, one of which contains the UUID. More...
 
 alexaClientSDK::acsdkBluetooth::test::TEST_P (SQLiteBluetoothStorageParameterizedTests, test_getUuidNoMatchingFails)
 Test getUuid with no matching UUID. More...
 
 alexaClientSDK::acsdkBluetooth::test::TEST_P (SQLiteBluetoothStorageParameterizedTests, test_getMacWithOneSucceeds)
 Test getMac with one row containing MAC. More...
 
 alexaClientSDK::acsdkBluetooth::test::TEST_P (SQLiteBluetoothStorageParameterizedTests, test_getMacWithMultipleSucceeds)
 Test getMac with multiple rows, one of which contains the MAC. More...
 
 alexaClientSDK::acsdkBluetooth::test::TEST_P (SQLiteBluetoothStorageParameterizedTests, test_getMacNoMatchingFails)
 Test getMac with no matching MAC. More...
 
 alexaClientSDK::acsdkBluetooth::test::TEST_P (SQLiteBluetoothStorageParameterizedTests, getCategoryWithOneSucceeds)
 Test getCategory with one row containing Unknown Category. More...
 
 alexaClientSDK::acsdkBluetooth::test::TEST_P (SQLiteBluetoothStorageParameterizedTests, getCategoryWithMultipleSucceeds)
 Test getCategory with multiple rows, two of which contains UNKNOWN, one is updated to PHONE. More...
 
 alexaClientSDK::acsdkBluetooth::test::TEST_P (SQLiteBluetoothStorageParameterizedTests, getCategoryWithMultipleInsertByMacSucceeds)
 
 alexaClientSDK::acsdkBluetooth::test::TEST_P (SQLiteBluetoothStorageParameterizedTests, getCategoryNoMatchingFails)
 Test getCategory with no matching category for given uuid. More...
 
 alexaClientSDK::acsdkBluetooth::test::TEST_P (SQLiteBluetoothStorageParameterizedTests, test_getMacToUuidWithOneRowSucceeds)
 Test getMacToUuid with one row. More...
 
 alexaClientSDK::acsdkBluetooth::test::TEST_P (SQLiteBluetoothStorageParameterizedTests, test_getMacToUuidWithMultipleRowsSucceeds)
 Test getMacToUuid with multiple expected. More...
 
 alexaClientSDK::acsdkBluetooth::test::TEST_P (SQLiteBluetoothStorageParameterizedTests, test_getMacToUuidWithEmptySucceeds)
 Test getMacToUuid when empty. More...
 
 alexaClientSDK::acsdkBluetooth::test::TEST_P (SQLiteBluetoothStorageParameterizedTests, test_getUuidToMacWithOneRowSucceeds)
 Test getUuidToMac with one row. More...
 
 alexaClientSDK::acsdkBluetooth::test::TEST_P (SQLiteBluetoothStorageParameterizedTests, test_getUuidToMacWithMultipleRowsSucceeds)
 Test getUuidToMac with multiple expected. More...
 
 alexaClientSDK::acsdkBluetooth::test::TEST_P (SQLiteBluetoothStorageParameterizedTests, test_getUuidToMacWithEmptySucceeds)
 Test getUuidToMac when empty. More...
 
 alexaClientSDK::acsdkBluetooth::test::TEST_P (SQLiteBluetoothStorageParameterizedTests, getUuidToCategoryWithOneRowSucceeds)
 Test getUuidToCategory with one row. More...
 
 alexaClientSDK::acsdkBluetooth::test::TEST_P (SQLiteBluetoothStorageParameterizedTests, getUuidToCategoryWithOneRowUpdateCategorySucceeds)
 Test getUuidToCategory with one row, updated category to PHONE. More...
 
 alexaClientSDK::acsdkBluetooth::test::TEST_P (SQLiteBluetoothStorageParameterizedTests, getUuidToCategoryWithMultipleRowsSucceeds)
 Test getUuidToCategory with multiple expected. More...
 
 alexaClientSDK::acsdkBluetooth::test::TEST_P (SQLiteBluetoothStorageParameterizedTests, getUuidToCategoryWithEmptySucceeds)
 Test getUuidToCategory when empty. More...
 
 alexaClientSDK::acsdkBluetooth::test::TEST_P (SQLiteBluetoothStorageParameterizedTests, getMacToCategoryWithOneRowSucceeds)
 Test getMacToCategory with one row. More...
 
 alexaClientSDK::acsdkBluetooth::test::TEST_P (SQLiteBluetoothStorageParameterizedTests, getMacToCategoryWithOneRowUpdateCategorySucceeds)
 Test getMacToCategory with one row, updated category to PHONE. More...
 
 alexaClientSDK::acsdkBluetooth::test::TEST_P (SQLiteBluetoothStorageParameterizedTests, getMacToCategoryWithMultipleRowsSucceeds)
 Test getMacToCategory with multiple expected. More...
 
 alexaClientSDK::acsdkBluetooth::test::TEST_P (SQLiteBluetoothStorageParameterizedTests, getMacToCategoryWithEmptySucceeds)
 Test getMacToCategory when empty. More...
 
 alexaClientSDK::acsdkBluetooth::test::TEST_P (SQLiteBluetoothStorageParameterizedTests, test_getOrderedMacAscending)
 Test getOrderedMac and retrieve the macs in ascending insertion order (oldest first). More...
 
 alexaClientSDK::acsdkBluetooth::test::TEST_P (SQLiteBluetoothStorageParameterizedTests, test_getOrderedMacDescending)
 Test getOrderedMac and retrieve the macs in descending insertion order (newest first). More...
 
 alexaClientSDK::acsdkBluetooth::test::TEST_P (SQLiteBluetoothStorageParameterizedTests, updateByCategorySucceeds)
 Test updateByCategory succeeds. More...
 
 alexaClientSDK::acsdkBluetooth::test::TEST_P (SQLiteBluetoothStorageParameterizedTests, updateByCategoryNoMatchingFails)
 Test updateByCategory with no matching uuid. More...
 
 alexaClientSDK::acsdkBluetooth::test::TEST_P (SQLiteBluetoothStorageParameterizedTests, test_insertByMacSucceeds)
 Test insertByMac succeeds. More...
 
 alexaClientSDK::acsdkBluetooth::test::TEST_P (SQLiteBluetoothStorageParameterizedTests, test_insertByMacDuplicateFails)
 Test insertByMac existing fails. More...
 
 alexaClientSDK::acsdkBluetooth::test::TEST_P (SQLiteBluetoothStorageParameterizedTests, test_insertByMacOverwriteSucceeds)
 Test insertByMac with overwrite succeeds. More...
 
 alexaClientSDK::acsdkBluetooth::test::TEST_P (SQLiteBluetoothStorageParameterizedTests, test_removeExistingSucceeds)
 Test remove succeeds. More...
 
 alexaClientSDK::acsdkBluetooth::test::TEST_P (SQLiteBluetoothStorageParameterizedTests, test_removeNonExistingSucceeds)
 Test remove on non-existing record succeeds. More...
 

Variables

static const std::string alexaClientSDK::acsdkBluetooth::test::TEST_DATABASE = "SQLiteBluetoothStorageTestDatabase.db"
 Test Database file name. Can be changed if there are conflicts. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::BLUETOOTH_JSON
 
static const std::string alexaClientSDK::acsdkBluetooth::test::FILE_EXISTS_ERROR = "Database File " + TEST_DATABASE + " already exists."
 Error message for when the file already exists. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::TEST_MAC = "01:23:45:67:89:ab"
 Test MAC Address. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::TEST_MAC_2 = "11:23:45:67:89:ab"
 Second Test MAC Address. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::TEST_UUID = "650f973b-c2ab-4c6e-bff4-3788cd521340"
 Test UUID. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::TEST_UUID_2 = "750f973b-c2ab-4c6e-bff4-3788cd521340"
 Second Test UUID. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::TEST_UNKNOWN = "UNKNOWN"
 Test Unknown MAC/Category. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::TEST_OTHER = "OTHER"
 Test Other Category. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::TEST_PHONE = "PHONE"
 Test Phone Category. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::UUID_TABLE_NAME = "uuidMapping"
 Table name. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::COLUMN_UUID = "uuid"
 The UUID column. More...
 
static const std::string alexaClientSDK::acsdkBluetooth::test::COLUMN_MAC = "mac"
 The MAC address column. More...
 

AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0