diff options
author | Kamil Konieczny <kamil.konieczny@linux.intel.com> | 2022-02-15 13:17:23 +0100 |
---|---|---|
committer | Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> | 2022-02-16 09:10:18 +0100 |
commit | 37ea4c86f97c0e05fcb6b04cff72ec927930536e (patch) | |
tree | 69f09b3309e96ff24ca48b618de3abc92ead58b2 /tests/i915/api_intel_allocator.c | |
parent | caac963c2673dc4fb25150575ead847ab3b6a3d1 (diff) |
i915/api_intel_allocator: fix standalone subtest
Subtest standalone uses igt_fork macro and after that makes
checks of work done by children processes, but this macro start
counting from zero, it never touches index 2. Correct indicies,
comment and asserts accordingly.
This wasn't observed in CI due to HIGH_TO_LOW strategy used as
default in allocator so first obtained offset was never zero.
v2: correct comment, indices and checks (Zbigniew review)
Signed-off-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Cc: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Diffstat (limited to 'tests/i915/api_intel_allocator.c')
-rw-r--r-- | tests/i915/api_intel_allocator.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/i915/api_intel_allocator.c b/tests/i915/api_intel_allocator.c index 6d7764ca..bb1b3838 100644 --- a/tests/i915/api_intel_allocator.c +++ b/tests/i915/api_intel_allocator.c @@ -313,10 +313,10 @@ static void standalone(int fd) igt_fork(child, 2) { /* - * Use standalone allocator for child 1, detach from parent, - * child 2 use allocator from parent. + * Use standalone allocator for child 0, detach from parent, + * child 1 use allocator from parent. */ - if (child == 1) + if (child == 0) intel_allocator_init(); ahnd = intel_allocator_open(fd, 0, INTEL_ALLOCATOR_SIMPLE); @@ -326,8 +326,8 @@ static void standalone(int fd) intel_allocator_close(ahnd); } igt_waitchildren(); - igt_assert_eq(offset, shared[1]); - igt_assert_neq(offset, shared[2]); + igt_assert_eq(offset, shared[0]); + igt_assert_neq(offset, shared[1]); intel_allocator_free(ahnd, handle); igt_assert_eq(intel_allocator_close(ahnd), true); |