@@ -1605,21 +1605,22 @@ test_order_violation(void **state)
16051605 UTEST_ADD_MODULE (schema , LYS_IN_YANG , NULL , & mod );
16061606
16071607 /* inserting a new node causes the nodes to be sorted */
1608- data = "{\"a:ll\":[1, 8,2]}" ;
1608+ data = "{\"a:ll\":[8,2,1 ]}" ;
16091609 CHECK_PARSE_LYD_PARAM (data , LYD_JSON , LYD_PARSE_ORDERED , LYD_VALIDATE_PRESENT , LY_SUCCESS , tree );
1610- assert_true (tree && !tree -> meta && tree -> next && tree -> next -> next );
1611- assert_string_equal (lyd_get_value (tree ), "1" );
1612- assert_string_equal (lyd_get_value (tree -> next ), "8" );
1613- assert_string_equal (lyd_get_value (tree -> next -> next ), "2" );
16141610#ifndef NDEBUG
16151611 CHECK_LOG_CTX ("Data in \"ll\" are not sorted, inserted node should not be added to the end." , NULL , 0 );
1612+ CHECK_LOG_CTX ("Data in \"ll\" are not sorted, inserted node should not be added to the end." , NULL , 0 );
16161613#endif
1617- assert_int_equal (lyd_new_term (NULL , mod , "ll" , "3" , 0 , & node ), LY_SUCCESS );
1618- lyd_insert_sibling (tree , node , NULL );
1619- assert_string_equal (lyd_get_value (tree ), "1" );
1614+ assert_true (tree && !tree -> meta && tree -> next && tree -> next -> next );
1615+ assert_string_equal (lyd_get_value (tree ), "8" );
16201616 assert_string_equal (lyd_get_value (tree -> next ), "2" );
1621- assert_string_equal (lyd_get_value (tree -> next -> next ), "3" );
1622- assert_string_equal (lyd_get_value (tree -> next -> next -> next ), "8" );
1617+ assert_string_equal (lyd_get_value (tree -> next -> next ), "1" );
1618+ assert_int_equal (lyd_new_term (NULL , mod , "ll" , "3" , 0 , & node ), LY_SUCCESS );
1619+ lyd_insert_sibling (tree , node , & first );
1620+ assert_string_equal (lyd_get_value (first ), "1" );
1621+ assert_string_equal (lyd_get_value (first -> next ), "2" );
1622+ assert_string_equal (lyd_get_value (first -> next -> next ), "3" );
1623+ assert_string_equal (lyd_get_value (first -> next -> next -> next ), "8" );
16231624 lyd_free_all (tree );
16241625
16251626 /* move unsorted nodes causes the nodes to be sorted */
0 commit comments