AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Classes | Typedefs | Functions | Variables
AssetManagerEvictionTest.cpp File Reference
#include "AssetManagerTest.h"
Include dependency graph for AssetManagerEvictionTest.cpp:

Classes

struct  EvictionData
 
class  EvictionTest
 

Typedefs

using P = Priority
 

Functions

 TEST_P (EvictionTest, LastUsedScenario)
 
 TEST_P (EvictionTest, RestartingAssetManagerPreservesLastUsed)
 
 TEST_P (EvictionTest, LoweringBudgetScenario)
 
 INSTANTIATE_TEST_CASE_P (EvictionTestCases, EvictionTest, ValuesIn< vector< EvictionData >>({{{P::UNUSED, P::UNUSED, P::UNUSED}, {0, 1, 2}, 0 *MB, true, {KEPT, KEPT, KEPT}, "Requesting 0 bytes preserves all the artifacts"}, {{P::UNUSED, P::UNUSED, P::UNUSED}, {0, 1, 2}, 9 *MB, true, {ERASED, KEPT, KEPT}, "Remove only as many artifacts that are needed to free up the requested space"}, {{P::UNUSED, P::UNUSED, P::UNUSED}, {0, 1, 2}, 25 *MB, true, {ERASED, ERASED, ERASED}, "Remove all unused artifacts if necessary to clear up space"}, {{P::UNUSED, P::UNUSED, P::UNUSED}, {0, 1, 2}, 31 *MB, false, {ERASED, ERASED, ERASED}, "Inform caller that we failed to clear sufficient space even after clearing all unused artifacts"}, {{P::ACTIVE, P::UNUSED, P::PENDING_ACTIVATION}, {0, 1, 2}, 15 *MB, false, {KEPT, ERASED, KEPT}, "Never clear active or pending activation priorities even if more space is requested"}, {{P::LIKELY_TO_BE_ACTIVE, P::UNUSED, P::UNUSED}, {2, 1, 0}, 20 *MB, true, {KEPT, ERASED, ERASED}, "Start erasing artifacts with lowest priority even if they were more recently used"}, {{P::UNUSED, P::UNUSED, P::UNUSED}, {1, 2, 0}, 10 *MB, true, {KEPT, ERASED, KEPT}, "If priority is the same then erase the oldest used artifact"}, }), PrintDescription())
 

Variables

static constexpr bool ERASED = true
 
static constexpr bool KEPT = false
 
const auto MB = 1024 * 4
 
const auto ARTIFACT_SIZE = 10 * MB
 

Typedef Documentation

◆ P

using P = Priority

Function Documentation

◆ INSTANTIATE_TEST_CASE_P()

INSTANTIATE_TEST_CASE_P ( EvictionTestCases  ,
EvictionTest  ,
ValuesIn< vector< EvictionData >>  {{{P::UNUSED, P::UNUSED, P::UNUSED}, {0, 1, 2}, 0 *MB, true, {KEPT, KEPT, KEPT}, "Requesting 0 bytes preserves all the artifacts"}, {{P::UNUSED, P::UNUSED, P::UNUSED}, {0, 1, 2}, 9 *MB, true, {ERASED, KEPT, KEPT}, "Remove only as many artifacts that are needed to free up the requested space"}, {{P::UNUSED, P::UNUSED, P::UNUSED}, {0, 1, 2}, 25 *MB, true, {ERASED, ERASED, ERASED}, "Remove all unused artifacts if necessary to clear up space"}, {{P::UNUSED, P::UNUSED, P::UNUSED}, {0, 1, 2}, 31 *MB, false, {ERASED, ERASED, ERASED}, "Inform caller that we failed to clear sufficient space even after clearing all unused artifacts"}, {{P::ACTIVE, P::UNUSED, P::PENDING_ACTIVATION}, {0, 1, 2}, 15 *MB, false, {KEPT, ERASED, KEPT}, "Never clear active or pending activation priorities even if more space is requested"}, {{P::LIKELY_TO_BE_ACTIVE, P::UNUSED, P::UNUSED}, {2, 1, 0}, 20 *MB, true, {KEPT, ERASED, ERASED}, "Start erasing artifacts with lowest priority even if they were more recently used"}, {{P::UNUSED, P::UNUSED, P::UNUSED}, {1, 2, 0}, 10 *MB, true, {KEPT, ERASED, KEPT}, "If priority is the same then erase the oldest used artifact"}, },
PrintDescription()   
)

◆ TEST_P() [1/3]

TEST_P ( EvictionTest  ,
LastUsedScenario   
)

◆ TEST_P() [2/3]

TEST_P ( EvictionTest  ,
RestartingAssetManagerPreservesLastUsed   
)

◆ TEST_P() [3/3]

TEST_P ( EvictionTest  ,
LoweringBudgetScenario   
)

Variable Documentation

◆ ARTIFACT_SIZE

const auto ARTIFACT_SIZE = 10 * MB

◆ ERASED

constexpr bool ERASED = true
static

◆ KEPT

constexpr bool KEPT = false
static

◆ MB

const auto MB = 1024 * 4

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