File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -100,6 +100,7 @@ ln2_glob_test_setup(struct ln2_test_ctx **test_ctx)
100100
101101 * test_ctx = calloc (1 , sizeof * * test_ctx );
102102 if (!* test_ctx ) {
103+ SETUP_FAIL_LOG ;
103104 ret = 1 ;
104105 goto cleanup ;
105106 }
@@ -110,34 +111,40 @@ ln2_glob_test_setup(struct ln2_test_ctx **test_ctx)
110111 /* initialize server */
111112 ret = nc_server_init ();
112113 if (ret ) {
114+ SETUP_FAIL_LOG ;
113115 goto cleanup ;
114116 }
115117
116118 /* initialize client */
117119 ret = nc_client_init ();
118120 if (ret ) {
121+ SETUP_FAIL_LOG ;
119122 goto cleanup ;
120123 }
121124
122125 /* init barrier */
123126 ret = pthread_barrier_init (& (* test_ctx )-> barrier , NULL , 2 );
124127 if (ret ) {
128+ SETUP_FAIL_LOG ;
125129 goto cleanup ;
126130 }
127131
128132 /* create libyang context */
129133 ret = ly_ctx_new (MODULES_DIR , 0 , & (* test_ctx )-> ctx );
130134 if (ret ) {
135+ SETUP_FAIL_LOG ;
131136 goto cleanup ;
132137 }
133138
134139 /* load default yang modules */
135140 ret = nc_server_init_ctx (& (* test_ctx )-> ctx );
136141 if (ret ) {
142+ SETUP_FAIL_LOG ;
137143 goto cleanup ;
138144 }
139145 ret = nc_server_config_load_modules (& (* test_ctx )-> ctx );
140146 if (ret ) {
147+ SETUP_FAIL_LOG ;
141148 goto cleanup ;
142149 }
143150
Original file line number Diff line number Diff line change 2424#define NC_ACCEPT_TIMEOUT 2000
2525#define NC_PS_POLL_TIMEOUT 2000
2626
27+ #define SETUP_FAIL_LOG \
28+ fprintf(stderr, "Setup fail in %s:%d.\n", __FILE__, __LINE__)
29+
2730/**
2831 * @brief Test context used for sharing data between the test and the server/client threads.
2932 */
You can’t perform that action at this time.
0 commit comments