tests: fix cast compilation warning

Signed-off-by: Loic Dachary <ldachary@redhat.com>
Merge pull request #2930 from dachary/wip-warning

tests: fix cast compilation warning