-
Notifications
You must be signed in to change notification settings - Fork 70
/
Copy pathApiTest.cpp
72 lines (56 loc) · 1.84 KB
/
ApiTest.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/crt/Api.h>
#include <aws/crt/Config.h>
#include <aws/crt/Types.h>
#include <aws/testing/aws_test_harness.h>
static int s_TestApiMultiCreateDestroy(struct aws_allocator *allocator, void *)
{
{
Aws::Crt::ApiHandle apiHandle(allocator);
}
{
Aws::Crt::ApiHandle apiHandle(allocator);
}
return AWS_ERROR_SUCCESS;
}
AWS_TEST_CASE(ApiMultiCreateDestroy, s_TestApiMultiCreateDestroy)
static int s_TestApiMultiDefaultCreateDestroy(struct aws_allocator *allocator, void *)
{
(void)allocator;
{
Aws::Crt::ApiHandle apiHandle;
}
{
Aws::Crt::ApiHandle apiHandle;
}
return AWS_ERROR_SUCCESS;
}
AWS_TEST_CASE(ApiMultiDefaultCreateDestroy, s_TestApiMultiDefaultCreateDestroy)
static int s_TestApiStaticDefaultCreateDestroy(struct aws_allocator *allocator, void *)
{
{
Aws::Crt::ApiHandle apiHandle(allocator);
Aws::Crt::ApiHandle::GetOrCreateStaticDefaultClientBootstrap();
}
{
Aws::Crt::ApiHandle apiHandle(allocator);
Aws::Crt::ApiHandle::GetOrCreateStaticDefaultClientBootstrap();
}
return AWS_ERROR_SUCCESS;
}
AWS_TEST_CASE(ApiStaticDefaultCreateDestroy, s_TestApiStaticDefaultCreateDestroy)
static int s_TestApiVersionReporting(struct aws_allocator *allocator, void *)
{
{
Aws::Crt::ApiHandle apiHandle(allocator);
Aws::Crt::ApiHandle::Version version = apiHandle.GetCrtVersion();
ASSERT_UINT_EQUALS(version.major, AWS_CRT_CPP_VERSION_MAJOR);
ASSERT_UINT_EQUALS(version.minor, AWS_CRT_CPP_VERSION_MINOR);
ASSERT_UINT_EQUALS(version.patch, AWS_CRT_CPP_VERSION_PATCH);
}
return AWS_ERROR_SUCCESS;
}
AWS_TEST_CASE(ApiStaticVersionReporting, s_TestApiVersionReporting)