-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathcom_wrapper_int.c
More file actions
50 lines (36 loc) · 1.24 KB
/
com_wrapper_int.c
File metadata and controls
50 lines (36 loc) · 1.24 KB
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
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#include "testrunnerswitcher.h"
#include "c_pal/gballoc_hl.h"
#include "c_pal/gballoc_hl_redirect.h"
#include "c_pal/timed_test_suite.h"
#include "real_gballoc_hl.h"
#include "test_object_custom_alloc_wrapper.h"
BEGIN_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE)
TIMED_TEST_SUITE_INITIALIZE(suite_initialize, TIMED_TEST_DEFAULT_TIMEOUT_MS)
{
ASSERT_ARE_EQUAL(int, 0, real_gballoc_hl_init(NULL, NULL));
}
TIMED_TEST_SUITE_CLEANUP(suite_cleanup)
{
real_gballoc_hl_deinit();
}
TEST_FUNCTION_INITIALIZE(test_initialize)
{
}
TEST_FUNCTION_CLEANUP(test_cleanup)
{
}
TEST_FUNCTION(custom_allocator_create_and_release_succeeds)
{
// arrange
TEST_OBJECT_HANDLE test_object = test_object_create("haga");
ASSERT_IS_NOT_NULL(test_object);
// act
ITestInterface* custom_interface = COM_WRAPPER_CREATE(TEST_OBJECT_CUSTOM_ALLOC_HANDLE, ITestInterface, (TEST_OBJECT_CUSTOM_ALLOC_HANDLE)test_object, test_object_destroy);
// assert
ASSERT_IS_NOT_NULL(custom_interface);
// cleanup
(void)custom_interface->lpVtbl->Release(custom_interface);
}
END_TEST_SUITE(TEST_SUITE_NAME_FROM_CMAKE)