diff options
author | Amitay Isaacs <amitay@ozlabs.org> | 2019-03-27 17:44:57 +1100 |
---|---|---|
committer | Alistair Popple <alistair@popple.id.au> | 2019-03-28 13:18:02 +1100 |
commit | 854c4c5facff43af9e0fe5d7062b58f631987b0b (patch) | |
tree | 7dcdadb56d60f86b85447e074696efbf787906aa | |
parent | 51ca1a18d56948aeaae8599e6629aebb0b501519 (diff) | |
download | pdbg-854c4c5facff43af9e0fe5d7062b58f631987b0b.tar.gz pdbg-854c4c5facff43af9e0fe5d7062b58f631987b0b.zip |
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.c | 6 |
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) { |