| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
Add unit test of memRouter. Signed-off-by: yangxin <245051644@qq.com> | 3 年前 | |
memRouter: test: Fix -Wincompatible-pointer-types warnings I ran into the following warnings, --------------------------------------------------------------------- In file included from /usr/include/CUnit/Automated.h:41:0, from /root/dev/etmem/memRouter/test/Unit/memdcd_process_llt_test/memdcd_process_llt.c:18: /root/dev/etmem/memRouter/test/Unit/memdcd_process_llt_test/memdcd_process_llt.c: In function ‘test_memdcd_process’: /root/dev/etmem/memRouter/test/Unit/memdcd_process_llt_test/memdcd_process_llt.c:38:51: warning: passing argument 2 of ‘migrate_process_get_pages’ from incompatible pointer type [-Wincompatible-pointer-types] CU_ASSERT_EQUAL(migrate_process_get_pages(-1, wrong_msg->memory_msg.vma.vma_addrs), -1); ^ In file included from /root/dev/etmem/memRouter/test/Unit/memdcd_process_llt_test/memdcd_process_llt.c:19:0: /root/dev/etmem/memRouter/test/Unit/memdcd_process_llt_test/../../../src/memdcd_process.c:323:5: note: expected ‘const struct swap_vma_with_count *’ but argument is of type ‘struct vma_addr_with_count *’ int migrate_process_get_pages(int pid, const struct swap_vma_with_count *vma) ^~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/CUnit/Automated.h:41:0, from /root/dev/etmem/memRouter/test/Unit/memdcd_process_llt_test/memdcd_process_llt.c:18: /root/dev/etmem/memRouter/test/Unit/memdcd_process_llt_test/memdcd_process_llt.c:39:66: warning: passing argument 2 of ‘migrate_process_get_pages’ from incompatible pointer type [-Wincompatible-pointer-types] CU_ASSERT_EQUAL(migrate_process_get_pages(get_pid_max() + 1, wrong_msg->memory_msg.vma.vma_addrs), -1); ^ In file included from /root/dev/etmem/memRouter/test/Unit/memdcd_process_llt_test/memdcd_process_llt.c:19:0: /root/dev/etmem/memRouter/test/Unit/memdcd_process_llt_test/../../../src/memdcd_process.c:323:5: note: expected ‘const struct swap_vma_with_count *’ but argument is of type ‘struct vma_addr_with_count *’ int migrate_process_get_pages(int pid, const struct swap_vma_with_count *vma) ^~~~~~~~~~~~~~~~~~~~~~~~~ --------------------------------------------------------------------- The reason for this warning is the use of the wrong member variable, and that must be an oversight. Tested on x86_64 openEuler 20.03, 22.03 and 24.03. Signed-off-by: Enze Li <lienze@kylinos.cn> | 2 年前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 3 年前 | ||
| 2 年前 |