OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <stdint.h> | 5 #include <stdint.h> |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "codec_int.h" | 9 #include "codec_int.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 y.dx = 1; | 491 y.dx = 1; |
492 y.dy = 1; | 492 y.dy = 1; |
493 y.prec = 8; | 493 y.prec = 8; |
494 y.bpp = 8; | 494 y.bpp = 8; |
495 opj_image_t img; | 495 opj_image_t img; |
496 memset(&img, 0, sizeof(img)); | 496 memset(&img, 0, sizeof(img)); |
497 img.numcomps = 3; | 497 img.numcomps = 3; |
498 img.color_space = OPJ_CLRSPC_SYCC; | 498 img.color_space = OPJ_CLRSPC_SYCC; |
499 img.comps = FX_Alloc(opj_image_comp_t, 3); | 499 img.comps = FX_Alloc(opj_image_comp_t, 3); |
500 const struct { | 500 const struct { |
501 int w; | 501 OPJ_UINT32 w; |
502 bool expected; | 502 bool expected; |
503 } cases[] = {{0, false}, | 503 } cases[] = {{0, false}, |
504 {1, false}, | 504 {1, false}, |
505 {30, false}, | 505 {30, false}, |
506 {31, true}, | 506 {31, true}, |
507 {32, true}, | 507 {32, true}, |
508 {33, true}, | 508 {33, true}, |
509 {34, false}, | 509 {34, false}, |
510 {UINT_MAX, false}}; | 510 {UINT_MAX, false}}; |
511 for (int i = 0; i < sizeof(cases) / sizeof(cases[0]); ++i) { | 511 for (int i = 0; i < sizeof(cases) / sizeof(cases[0]); ++i) { |
(...skipping 21 matching lines...) Expand all Loading... |
533 EXPECT_NE(img.comps[0].h, img.comps[1].h); | 533 EXPECT_NE(img.comps[0].h, img.comps[1].h); |
534 EXPECT_NE(img.comps[0].w, img.comps[2].w); | 534 EXPECT_NE(img.comps[0].w, img.comps[2].w); |
535 EXPECT_NE(img.comps[0].h, img.comps[2].h); | 535 EXPECT_NE(img.comps[0].h, img.comps[2].h); |
536 } | 536 } |
537 FX_Free(img.comps[0].data); | 537 FX_Free(img.comps[0].data); |
538 FX_Free(img.comps[1].data); | 538 FX_Free(img.comps[1].data); |
539 FX_Free(img.comps[2].data); | 539 FX_Free(img.comps[2].data); |
540 } | 540 } |
541 FX_Free(img.comps); | 541 FX_Free(img.comps); |
542 } | 542 } |
OLD | NEW |