15 #ifndef ALEXA_CLIENT_SDK_APPLICATIONUTILITIES_ANDROIDUTILITIES_TEST_ANDROIDUTILITIES_MOCKANDROIDSLESOBJECT_H_ 16 #define ALEXA_CLIENT_SDK_APPLICATIONUTILITIES_ANDROIDUTILITIES_TEST_ANDROIDUTILITIES_MOCKANDROIDSLESOBJECT_H_ 18 #include <unordered_map> 19 #include <SLES/OpenSLES.h> 24 namespace applicationUtilities {
25 namespace androidUtilities {
48 void mockGetInterface(SLInterfaceID
id, std::shared_ptr<MockInterface>
object);
70 SLObjectItf_** m_slObject;
74 static std::unordered_map<SLInterfaceID, std::shared_ptr<MockInterface>>
g_interfaces;
77 return SL_RESULT_SUCCESS;
81 return SL_RESULT_INTERNAL_ERROR;
85 auto it = g_interfaces.find(
id);
86 if (it != g_interfaces.end() && it->second !=
nullptr) {
87 it->second->set(interface);
88 return SL_RESULT_SUCCESS;
90 return SL_RESULT_CONTENT_NOT_FOUND;
94 g_interfaces[id] = object;
106 auto object =
new SLObjectItf_();
107 auto objectPtr =
new SLObjectItf_*();
109 m_slObject = objectPtr;
112 (*m_slObject)->Destroy = [](SLObjectItf obj) {};
118 g_interfaces.clear();
126 #endif // ALEXA_CLIENT_SDK_APPLICATIONUTILITIES_ANDROIDUTILITIES_TEST_ANDROIDUTILITIES_MOCKANDROIDSLESOBJECT_H_
MockAndroidSLESObject()
Definition: MockAndroidSLESObject.h:105
SLresult realizeFailed(SLObjectItf self, SLboolean async)
Definition: MockAndroidSLESObject.h:80
Definition: AmdMetricWrapperTest.cpp:24
SLresult realizeSucceed(SLObjectItf self, SLboolean async)
Definition: MockAndroidSLESObject.h:76
void mockGetInterface(SLInterfaceID id, std::shared_ptr< MockInterface > object)
Definition: MockAndroidSLESObject.h:93
static std::unordered_map< SLInterfaceID, std::shared_ptr< MockInterface > > g_interfaces
Definition: MockAndroidSLESObject.h:74
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
~MockAndroidSLESObject()
Definition: MockAndroidSLESObject.h:115
SLresult getMockInterface(SLObjectItf self, SLInterfaceID id, void *interface)
Definition: MockAndroidSLESObject.h:84
SLObjectItf getObject()
Definition: MockAndroidSLESObject.h:101
Definition: MockAndroidSLESObject.h:33
void mockRealize(bool succeed=true)
Definition: MockAndroidSLESObject.h:97