// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 #pragma once #include "test_common.h" #include #include namespace GameKit { namespace Tests { namespace CoreExports { static const char* DUMMY_INSTANCE_PATH = "tests/core/test_data/sampleplugin/dummyinstance"; std::unique_ptr coreS3Mock; std::unique_ptr coreSsmMock; std::unique_ptr coreCfnMock; std::unique_ptr coreSecretsMock; std::unique_ptr coreApigwMock; using namespace testing; namespace S3Model = Aws::S3::Model; namespace SSMModel = Aws::SSM::Model; namespace CfnModel = Aws::CloudFormation::Model; namespace SecretsModel = Aws::SecretsManager::Model; namespace ApigwModel = Aws::APIGateway::Model; class GameKitCoreExportsTestFixture; void* createAccountInstance(); void* createFeatureResourceInstance(GameKit::FeatureType featureType); void setAccountMocks(void*); void setResourceMocks(void*); // Templated structs that forward a callback to an object template struct CallbackHandler; template struct CallbackHandler { static RetType OnCallback(void* obj, Args... args) { Target* instance = static_cast(obj); return (instance->*CbFunc)(std::forward(args)...); } static RetType OnCallback(void* obj, Args&&... args) { Target* instance = static_cast(obj); return (instance->*CbFunc)(std::forward(args)...); } }; // Used as callback to handle c-strings class SimpleCaller { public: virtual void OnHandleResult(const char* result) = 0; }; } } }