1 /*
2 * Copyright (c) 2017 Intel Corporation
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7 #include <zephyr/kernel.h>
8 #include <zephyr/ztest.h>
9
10 #include "altera_avalon_sysid.h"
11
ZTEST(nios2_sysid,test_sysid)12 ZTEST(nios2_sysid, test_sysid)
13 {
14 int32_t sysid, status = TC_FAIL;
15
16 sysid = alt_avalon_sysid_test();
17 if (!sysid) {
18 status = TC_PASS;
19 TC_PRINT("[SysID] hardware and software appear to be in sync\n");
20 } else if (sysid > 0) {
21 TC_PRINT("[SysID] software appears to be older than hardware\n");
22 } else {
23 TC_PRINT("[SysID] hardware appears to be older than software\n");
24 }
25
26 zassert_equal(status, TC_PASS, "SysID test failed");
27 }
28
29 ZTEST_SUITE(nios2_sysid, NULL, NULL, NULL, NULL, NULL);
30