]> git.puffer.fish Git - mirror/frr.git/commitdiff
tests: use little-endian order for libyang api
authorMark Stapp <mjs@cisco.com>
Tue, 15 Apr 2025 17:15:09 +0000 (13:15 -0400)
committerMark Stapp <mjs@cisco.com>
Tue, 15 Apr 2025 17:15:09 +0000 (13:15 -0400)
Use the expected - little-endian - byte-order for a param
to one of the libyang apis; tests fail on LE architectures
otherwise.

Signed-off-by: Mark Stapp <mjs@cisco.com>
tests/lib/northbound/test_oper_data.c

index a38325173aa38cc4165ede53927efd0642f8c688..7a3618f3bfa8a28e35a823b3de9d27af68242d3c 100644 (file)
@@ -249,9 +249,10 @@ static enum nb_error frr_test_module_c2cont_c2value_get(const struct nb_node *nb
                                                        struct lyd_node *parent)
 {
        const struct lysc_node *snode = nb_node->snode;
-       uint32_t value = 0xAB010203;
+       uint32_t value = htole32(0xAB010203);
        LY_ERR err;
 
+       /* Note that this api expects 'value' to be in little-endian form */
        err = lyd_new_term_bin(parent, snode->module, snode->name, &value, sizeof(value),
                               LYD_NEW_PATH_UPDATE, NULL);
        assert(err == LY_SUCCESS);