AlexaClientSDK
3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
|
#include "AssetManagerTest.h"
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 |
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 | ( | EvictionTest | , |
LastUsedScenario | |||
) |
TEST_P | ( | EvictionTest | , |
RestartingAssetManagerPreservesLastUsed | |||
) |
TEST_P | ( | EvictionTest | , |
LoweringBudgetScenario | |||
) |
const auto ARTIFACT_SIZE = 10 * MB |
|
static |
|
static |
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