default_callbacks_test.cpp
Go to the documentation of this file.
1 /*
2  * Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License").
5  * You may not use this file except in compliance with the License.
6  * A copy of the License is located at
7  *
8  * http://aws.amazon.com/apache2.0
9  *
10  * or in the "license" file accompanying this file. This file is distributed
11  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12  * express or implied. See the License for the specific language governing
13  * permissions and limitations under the License.
14  */
15 
17 #include <gtest/gtest.h>
18 
19 using namespace Aws::Kinesis;
20 
21 TEST(ClientCallbackProviderSuite, defaultClientCallbackProviderTest)
22 {
24  UINT64 custom_handle;
25  UINT64 remaining_bytes;
26 
27  EXPECT_EQ(test_subject.storageOverflowPressure(custom_handle, remaining_bytes),
28  test_subject.getStorageOverflowPressureCallback()(custom_handle, remaining_bytes));
29  EXPECT_EQ(STATUS_SUCCESS,
30  test_subject.storageOverflowPressure(custom_handle, remaining_bytes));
31 }
32 
33 TEST(ClientCallbackProviderSuite, defaultStreamCallbackProviderTest)
34 {
35  DefaultStreamCallbackProvider test_subject;
36  UINT64 custom_data;
37  STREAM_HANDLE stream_handle;
38  UPLOAD_HANDLE upload_handle;
39  UINT64 last_buffering_ack;
40  UINT64 errored_timecode;
41  STATUS status_code;
42  UINT64 dropped_frame_timecode;
43 
44  EXPECT_EQ(STATUS_SUCCESS,
45  test_subject.getStreamConnectionStaleCallback()(custom_data, stream_handle, last_buffering_ack));
46  EXPECT_EQ(STATUS_SUCCESS,
47  test_subject.getStreamErrorReportCallback()(custom_data, stream_handle, upload_handle, errored_timecode, status_code));
48  EXPECT_EQ(STATUS_SUCCESS,
49  test_subject.getDroppedFrameReportCallback()(custom_data, stream_handle, dropped_frame_timecode));
50 }
51 
52 int main(int argc, char ** argv)
53 {
54  testing::InitGoogleTest(&argc, argv);
55  return RUN_ALL_TESTS();
56 }
TEST(ClientCallbackProviderSuite, defaultClientCallbackProviderTest)
static STATUS storageOverflowPressure(UINT64 custom_handle, UINT64 remaining_bytes)
StreamErrorReportFunc getStreamErrorReportCallback() override
StorageOverflowPressureFunc getStorageOverflowPressureCallback() override
StreamConnectionStaleFunc getStreamConnectionStaleCallback() override
DroppedFrameReportFunc getDroppedFrameReportCallback() override
int main(int argc, char **argv)


kinesis_manager
Author(s): AWS RoboMaker
autogenerated on Thu Mar 4 2021 03:28:41