@@ -197,7 +197,7 @@ test_plugin_sort(void **state)
197197 const char * schema ;
198198 struct lys_module * mod ;
199199 struct lyd_value val1 = {0 }, val2 = {0 };
200- struct lyplg_type * type = lysc_get_type_plugin ( lyplg_type_plugin_find ( NULL , "" , NULL , ly_data_type2str [ LY_TYPE_UNION ])) ;
200+ struct lyplg_type * type = NULL ;
201201 struct lysc_type * lysc_type ;
202202 struct ly_err_item * err = NULL ;
203203
@@ -212,6 +212,7 @@ test_plugin_sort(void **state)
212212
213213 /* ipv4-address */
214214 lysc_type = ((struct lysc_node_leaf * )mod -> compiled -> data )-> type ;
215+ type = lysc_get_type_plugin (lysc_type -> plugin_ref );
215216
216217 v1 = "192.168.0.1" ;
217218 assert_int_equal (LY_SUCCESS , type -> store (UTEST_LYCTX , lysc_type , v1 , strlen (v1 ) * 8 ,
@@ -239,7 +240,7 @@ test_plugin_sort(void **state)
239240
240241 /* ipv6-address */
241242 lysc_type = ((struct lysc_node_leaflist * )mod -> compiled -> data -> next )-> type ;
242- type = lysc_get_type_plugin (lyplg_type_plugin_find ( NULL , "" , NULL , ly_data_type2str [ LY_TYPE_STRING ]) );
243+ type = lysc_get_type_plugin (lysc_type -> plugin_ref );
243244
244245 v1 = "2008:15:0:0:0:0:feAC:1" ;
245246 assert_int_equal (LY_SUCCESS , type -> store (UTEST_LYCTX , lysc_type , v1 , strlen (v1 ) * 8 ,
@@ -267,7 +268,7 @@ test_plugin_sort(void **state)
267268
268269 /* ipv4-address-no-zone */
269270 lysc_type = ((struct lysc_node_leaflist * )mod -> compiled -> data -> next -> next )-> type ;
270- type = lysc_get_type_plugin (lyplg_type_plugin_find ( NULL , "" , NULL , ly_data_type2str [ LY_TYPE_UNION ]) );
271+ type = lysc_get_type_plugin (lysc_type -> plugin_ref );
271272 v1 = "127.0.0.1" ;
272273 assert_int_equal (LY_SUCCESS , type -> store (UTEST_LYCTX , lysc_type , v1 , strlen (v1 ) * 8 ,
273274 0 , LY_VALUE_JSON , NULL , LYD_VALHINT_STRING , NULL , & val1 , NULL , & err ));
@@ -282,7 +283,7 @@ test_plugin_sort(void **state)
282283
283284 /* ipv6-address-no-zone */
284285 lysc_type = ((struct lysc_node_leaflist * )mod -> compiled -> data -> next -> next -> next )-> type ;
285- type = lysc_get_type_plugin (lyplg_type_plugin_find ( NULL , "" , NULL , ly_data_type2str [ LY_TYPE_STRING ]) );
286+ type = lysc_get_type_plugin (lysc_type -> plugin_ref );
286287 v1 = "A:B:c:D:e:f:1:1" ;
287288 assert_int_equal (LY_SUCCESS , type -> store (UTEST_LYCTX , lysc_type , v1 , strlen (v1 ) * 8 ,
288289 0 , LY_VALUE_JSON , NULL , LYD_VALHINT_STRING , NULL , & val1 , NULL , & err ));
@@ -297,6 +298,7 @@ test_plugin_sort(void **state)
297298
298299 /* ipv4-prefix */
299300 lysc_type = ((struct lysc_node_leaflist * )mod -> compiled -> data -> next -> next -> next -> next )-> type ;
301+ type = lysc_get_type_plugin (lysc_type -> plugin_ref );
300302 v1 = "0.1.58.4/32" ;
301303 assert_int_equal (LY_SUCCESS , type -> store (UTEST_LYCTX , lysc_type , v1 , strlen (v1 ) * 8 ,
302304 0 , LY_VALUE_JSON , NULL , LYD_VALHINT_STRING , NULL , & val1 , NULL , & err ));
@@ -311,10 +313,11 @@ test_plugin_sort(void **state)
311313
312314 /* ipv6-prefix */
313315 lysc_type = ((struct lysc_node_leaflist * )mod -> compiled -> data -> next -> next -> next -> next -> next )-> type ;
314- v1 = "::C:D:E:f:a/96" ;
316+ type = lysc_get_type_plugin (lysc_type -> plugin_ref );
317+ v1 = "::C:D:E:f:a/112" ;
315318 assert_int_equal (LY_SUCCESS , type -> store (UTEST_LYCTX , lysc_type , v1 , strlen (v1 ) * 8 ,
316319 0 , LY_VALUE_JSON , NULL , LYD_VALHINT_STRING , NULL , & val1 , NULL , & err ));
317- v2 = "::C:D:E:f:a/112 " ;
320+ v2 = "::C:D:E:f:a/96 " ;
318321 assert_int_equal (LY_SUCCESS , type -> store (UTEST_LYCTX , lysc_type , v2 , strlen (v2 ) * 8 ,
319322 0 , LY_VALUE_JSON , NULL , LYD_VALHINT_STRING , NULL , & val2 , NULL , & err ));
320323 assert_true (0 < type -> sort (UTEST_LYCTX , & val1 , & val2 ));
0 commit comments