OSDN Git Service

gralloctest: update test for ARCVM
authorDavid Stevens <stevensd@chromium.org>
Tue, 27 Oct 2020 04:40:17 +0000 (13:40 +0900)
committerCommit Bot <commit-bot@chromium.org>
Wed, 28 Oct 2020 02:54:48 +0000 (02:54 +0000)
On ARCVM, the stride obtained from GRALLOC_DRM_GET_STRIDE is the host
stride, and may be larger than the guest stride.

This change also moves the line which prints the next test to execute to
before the test actually runs, so it appears before test failures.

BUG=b:155238003
TEST=tast run DUT arc.Gralloc*

Change-Id: I4594f352fba585fa4bdbaff609f198888b99c8f5
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2500971
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: David Stevens <stevensd@chromium.org>
Tested-by: David Stevens <stevensd@chromium.org>
cros_gralloc/gralloc0/tests/gralloctest.c

index f663cd0..c1b0a6e 100644 (file)
@@ -476,7 +476,7 @@ static int test_perform(struct gralloctest_context *ctx)
        CHECK(allocate(ctx->device, &info));
 
        CHECK(mod->perform(mod, GRALLOC_DRM_GET_STRIDE, info.handle, &stride) == 0);
-       CHECK(stride == info.stride);
+       CHECK(stride >= info.stride);
 
        CHECK(mod->perform(mod, GRALLOC_DRM_GET_FORMAT, info.handle, &format) == 0);
        CHECK(format == info.format);
@@ -674,11 +674,12 @@ int main(int argc, char *argv[])
                        if (strcmp(tests[i].name, name) && strcmp("all", name))
                                continue;
 
+                       printf("[ RUN      ] gralloctest.%s\n", tests[i].name);
+
                        int success = 1;
                        if (ctx->api >= tests[i].required_api)
                                success = tests[i].run_test(ctx);
 
-                       printf("[ RUN      ] gralloctest.%s\n", tests[i].name);
                        if (!success) {
                                fprintf(stderr, "[  FAILED  ] gralloctest.%s\n", tests[i].name);
                                ret |= 1;