#!/bin/sh

. ../../lib/sh-test-lib

uboot_variable_value() {
    # shellcheck disable=SC2039
    local var="$1"
    result=$("${UBOOT_VAR_TOOL}" "${var}")
    if [ -n "${result}" ]; then
        echo "${result#*=}"
    else
        echo ""
    fi
}

compare_test_value() {
    # shellcheck disable=SC2039
    local test_name="$1"
    # shellcheck disable=SC2039
    local expected_value="$2"
    # shellcheck disable=SC2039
    local tested_value="$3"

    echo "Testing: #${test_name}#"
    echo "Expected: #${expected_value}#"
    echo "Actual: #${tested_value}#"

    if [ "${expected_value}" = "${tested_value}" ]; then
        report_pass "${test_name}"
    else
        report_fail "${test_name}"
    fi
}
