OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2009, Google Inc. | 2 * Copyright 2009, Google Inc. |
3 * All rights reserved. | 3 * All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 25 matching lines...) Expand all Loading... |
36 #include "base/file_path.h" | 36 #include "base/file_path.h" |
37 #include "utils/cross/file_path_utils.h" | 37 #include "utils/cross/file_path_utils.h" |
38 | 38 |
39 namespace o3d { | 39 namespace o3d { |
40 | 40 |
41 class ImageTest : public testing::Test { | 41 class ImageTest : public testing::Test { |
42 }; | 42 }; |
43 | 43 |
44 TEST_F(ImageTest, CheckImageDimensions) { | 44 TEST_F(ImageTest, CheckImageDimensions) { |
45 EXPECT_TRUE(image::CheckImageDimensions(1u, 1u)); | 45 EXPECT_TRUE(image::CheckImageDimensions(1u, 1u)); |
46 EXPECT_FALSE(image::CheckImageDimensions(0u, 1u)); | |
47 EXPECT_FALSE(image::CheckImageDimensions(1u, 0u)); | |
48 EXPECT_TRUE(image::CheckImageDimensions(image::kMaxImageDimension, | 46 EXPECT_TRUE(image::CheckImageDimensions(image::kMaxImageDimension, |
49 image::kMaxImageDimension)); | 47 image::kMaxImageDimension)); |
50 EXPECT_FALSE(image::CheckImageDimensions(0u, image::kMaxImageDimension)); | 48 EXPECT_FALSE(image::CheckImageDimensions(0u, image::kMaxImageDimension + 1)); |
51 EXPECT_FALSE(image::CheckImageDimensions(image::kMaxImageDimension, 0u)); | 49 EXPECT_FALSE(image::CheckImageDimensions(image::kMaxImageDimension + 1, 0u)); |
52 } | 50 } |
53 | 51 |
54 TEST_F(ImageTest, ComputeMipMapCount) { | 52 TEST_F(ImageTest, ComputeMipMapCount) { |
55 EXPECT_EQ(image::ComputeMipMapCount(1, 1), 1); | 53 EXPECT_EQ(image::ComputeMipMapCount(1, 1), 1); |
56 EXPECT_EQ(image::ComputeMipMapCount(2, 2), 2); | 54 EXPECT_EQ(image::ComputeMipMapCount(2, 2), 2); |
57 EXPECT_EQ(image::ComputeMipMapCount(2, 1), 2); | 55 EXPECT_EQ(image::ComputeMipMapCount(2, 1), 2); |
58 EXPECT_EQ(image::ComputeMipMapCount(256, 1), 9); | 56 EXPECT_EQ(image::ComputeMipMapCount(256, 1), 9); |
59 EXPECT_EQ(image::ComputeMipMapCount(256, 256), 9); | 57 EXPECT_EQ(image::ComputeMipMapCount(256, 256), 9); |
60 } | 58 } |
61 | 59 |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 TEST_F(ImageTest, GetFileTypeFromMimeType) { | 295 TEST_F(ImageTest, GetFileTypeFromMimeType) { |
298 EXPECT_EQ(image::PNG, image::GetFileTypeFromMimeType("image/png")); | 296 EXPECT_EQ(image::PNG, image::GetFileTypeFromMimeType("image/png")); |
299 EXPECT_EQ(image::JPEG, image::GetFileTypeFromMimeType("image/jpeg")); | 297 EXPECT_EQ(image::JPEG, image::GetFileTypeFromMimeType("image/jpeg")); |
300 EXPECT_EQ(image::UNKNOWN, image::GetFileTypeFromFilename("text/plain")); | 298 EXPECT_EQ(image::UNKNOWN, image::GetFileTypeFromFilename("text/plain")); |
301 EXPECT_EQ(image::UNKNOWN, | 299 EXPECT_EQ(image::UNKNOWN, |
302 image::GetFileTypeFromFilename("application/x-123")); | 300 image::GetFileTypeFromFilename("application/x-123")); |
303 } | 301 } |
304 | 302 |
305 } // namespace | 303 } // namespace |
306 | 304 |
OLD | NEW |