summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Stapp <mjs@cisco.com>2025-04-15 13:15:09 -0400
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2025-04-16 08:51:19 +0000
commit0ede1a830285c3fa3a8424fa69486a217c1e05ce (patch)
tree3151cd881dc20c65c3a843d7514f839eb023b7cd
parent872ace0f0711eb7b7e2272cdd087b77e5af81439 (diff)
tests: use little-endian order for libyang api
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> (cherry picked from commit da8fce3830baa2fd4d70050a3f7677d6e8bd5ad4)
-rw-r--r--tests/lib/northbound/test_oper_data.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/lib/northbound/test_oper_data.c b/tests/lib/northbound/test_oper_data.c
index 0b334c6522..f66b78d14f 100644
--- a/tests/lib/northbound/test_oper_data.c
+++ b/tests/lib/northbound/test_oper_data.c
@@ -253,9 +253,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);