AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Namespaces | Enumerations | Functions | Variables
SafeTimeAccessTest.cpp File Reference
#include <ctime>
#include <thread>
#include <gtest/gtest.h>
#include "AVSCommon/Utils/Timing/SafeCTimeAccess.h"
Include dependency graph for SafeTimeAccessTest.cpp:

Namespaces

 alexaClientSDK
 Whether or not curl logs should be emitted.
 
 alexaClientSDK::avsCommon
 
 alexaClientSDK::avsCommon::utils
 
 alexaClientSDK::avsCommon::utils::timing
 
 alexaClientSDK::avsCommon::utils::timing::test
 

Enumerations

enum  alexaClientSDK::avsCommon::utils::timing::test::TestType { alexaClientSDK::avsCommon::utils::timing::test::TestType::GMTIME, alexaClientSDK::avsCommon::utils::timing::test::TestType::LOCALTIME }
 

Functions

 alexaClientSDK::avsCommon::utils::timing::test::TEST (SafeCTimeAccessTest, test_getGmtimeNullReturnValue)
 Test to verify that getGmtime returns failure if a nullptr is passed for the result variable. More...
 
 alexaClientSDK::avsCommon::utils::timing::test::TEST (SafeCTimeAccessTest, test_getLocaltimeNullReturnValue)
 Test to verify that getLocaltime returns failure if a nullptr is passed for the result variable. More...
 
static void alexaClientSDK::avsCommon::utils::timing::test::checkTm (const std::tm &a, const std::tm &b)
 
static void alexaClientSDK::avsCommon::utils::timing::test::testGmtimeHelper (const std::tm &expected, const time_t &t)
 
static void alexaClientSDK::avsCommon::utils::timing::test::testLocaltimeHelper (const std::tm &expected, const time_t &t)
 
 alexaClientSDK::avsCommon::utils::timing::test::TEST (SafeCTimeAccessTest, test_getGmtimeAtTheEpoch)
 Test to verify that getGmtime returns the correct calendar date for the Unix epoch. More...
 
 alexaClientSDK::avsCommon::utils::timing::test::TEST (SafeCTimeAccessTest, test_getGmtime)
 Test to verify that getGmtime returns the same calendar date as std::gmtime. More...
 
 alexaClientSDK::avsCommon::utils::timing::test::TEST (SafeCTimeAccessTest, test_getLocaltime)
 Test to verify that getLocaltime returns the same calendar date as std::localtime. More...
 
static void alexaClientSDK::avsCommon::utils::timing::test::callSafeCTimeFunction (int startingSeed, const TestType &type, std::vector< std::pair< time_t, std::tm >> *results)
 
static void alexaClientSDK::avsCommon::utils::timing::test::checkSafeCTimeFunction (const TestType &type)
 
 alexaClientSDK::avsCommon::utils::timing::test::TEST (SafeCTimeAccessTest, DISABLED_test_gmTimeMultithreadedAccess)
 Test to make sure that multithreaded access SafeCTimeAccess::getGmtime is safe. More...
 
 alexaClientSDK::avsCommon::utils::timing::test::TEST (SafeCTimeAccessTest, DISABLED_test_localtimeMultithreadedAccess)
 Test to make sure that multithreaded access SafeCTimeAccess::getLocaltimetime is safe. More...
 

Variables

const time_t alexaClientSDK::avsCommon::utils::timing::test::LARGE_TIME_VALUE = (0x1 << 30) - 1
 A bound on the upper time to check. More...
 
static std::mutex alexaClientSDK::avsCommon::utils::timing::test::g_resultsLock
 Mutex to guard access to the results vector. 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