summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@ozlabs.org>2019-03-27 17:44:57 +1100
committerAlistair Popple <alistair@popple.id.au>2019-03-28 13:18:02 +1100
commit854c4c5facff43af9e0fe5d7062b58f631987b0b (patch)
tree7dcdadb56d60f86b85447e074696efbf787906aa
parent51ca1a18d56948aeaae8599e6629aebb0b501519 (diff)
downloadpdbg-854c4c5facff43af9e0fe5d7062b58f631987b0b.zip
pdbg-854c4c5facff43af9e0fe5d7062b58f631987b0b.tar.gz
tests: Fix the core address calculation
fake.dts was changed to have fixed addresses for core (to be able to test exact dn name match). Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
-rw-r--r--src/tests/libpdbg_target_test.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tests/libpdbg_target_test.c b/src/tests/libpdbg_target_test.c
index eb5e0f4..73a831b 100644
--- a/src/tests/libpdbg_target_test.c
+++ b/src/tests/libpdbg_target_test.c
@@ -161,9 +161,9 @@ int main(void)
assert(!strncmp(name, "pib", 3));
}
- i = 0;
pdbg_for_each_class_target("core", target) {
uint64_t addr, size;
+ uint32_t index;
parent = pdbg_target_parent("fsi", target);
assert(parent);
@@ -207,10 +207,10 @@ int main(void)
name = pdbg_target_dn_name(target);
assert(!strncmp(name, "core", 4));
+ index = pdbg_target_index(target);
addr = pdbg_target_address(target, &size);
assert(size == 0);
- assert(addr == 0x10000 + (i / 4)*0x1000 + ((i % 4) + 1)*0x10);
- i++;
+ assert(addr == 0x10000 + (index + 1)*0x10);
}
pdbg_for_each_class_target("thread", target) {
OpenPOWER on IntegriCloud