Motr  M0
domain.c
Go to the documentation of this file.
1 /* -*- C -*- */
2 /*
3  * Copyright (c) 2013-2020 Seagate Technology LLC and/or its Affiliates
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  * For any questions about this software or licensing,
18  * please email opensource@seagate.com or cortx-questions@seagate.com.
19  *
20  */
21 
28 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_UT
29 #include "lib/trace.h"
30 
31 #include "dtm0/domain.h"
32 #include "lib/memory.h" /* M0_ALLOC_PTR */
33 #include "dtm0/cfg_default.h" /* m0_dtm0_domain_cfg_default_dup */
34 #include "ut/ut.h" /* M0_UT_ASSERT */
35 
36 
38 {
39  struct m0_dtm0_domain *dod;
40  struct m0_dtm0_domain_cfg *dod_cfg;
41  int rc;
42 
43  M0_ALLOC_PTR(dod);
44  M0_UT_ASSERT(dod != NULL);
45  M0_ALLOC_PTR(dod_cfg);
46  M0_UT_ASSERT(dod_cfg != NULL);
47 
49  M0_UT_ASSERT(rc == 0);
50 
51  m0_dtm0_domain_init(dod, dod_cfg);
53 
54  m0_dtm0_domain_cfg_free(dod_cfg);
55 
56  m0_free(dod_cfg);
57  m0_free(dod);
58 }
59 
60 #undef M0_TRACE_SUBSYSTEM
61 
64 /*
65  * Local variables:
66  * c-indentation-style: "K&R"
67  * c-basic-offset: 8
68  * tab-width: 8
69  * fill-column: 80
70  * scroll-step: 1
71  * End:
72  */
73 /*
74  * vim: tabstop=8 shiftwidth=8 noexpandtab textwidth=80 nowrap
75  */
M0_INTERNAL void m0_dtm0_domain_cfg_free(struct m0_dtm0_domain_cfg *dod_cfg)
Definition: cfg_default.c:60
#define NULL
Definition: misc.h:38
M0_INTERNAL int m0_dtm0_domain_init(struct m0_dtm0_domain *dod, struct m0_dtm0_domain_cfg *dod_cfg)
Definition: domain.c:183
#define M0_ALLOC_PTR(ptr)
Definition: memory.h:86
void m0_dtm0_ut_domain_init_fini(void)
Definition: domain.c:37
M0_INTERNAL void m0_dtm0_domain_fini(struct m0_dtm0_domain *dod)
Definition: domain.c:203
void m0_free(void *data)
Definition: memory.c:146
int32_t rc
Definition: trigger_fop.h:47
#define M0_UT_ASSERT(a)
Definition: ut.h:46
M0_INTERNAL int m0_dtm0_domain_cfg_default_dup(struct m0_dtm0_domain_cfg *dod_cfg)
Definition: cfg_default.c:37