Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Side by Side Diff: tests/FitsInTest.cpp

Issue 100113004: Use DEFINE_TESTCLASS_SHORT macro in tests. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/FillPathTest.cpp ('k') | tests/FlatDataTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "Test.h" 8 #include "Test.h"
9 9 #include "TestClassDef.h"
10 #include "SkTypes.h" 10 #include "SkTypes.h"
11 #include "SkTFitsIn.h" 11 #include "SkTFitsIn.h"
12
12 #include <limits> 13 #include <limits>
13 14
14 #define TEST(S, s, D, expected) REPORTER_ASSERT(reporter, (SkTFitsIn<D>((S)(s)) == (expected))) 15 #define TEST(S, s, D, expected) REPORTER_ASSERT(reporter, (SkTFitsIn<D>((S)(s)) == (expected)))
15 16
16 static void FitsInTest(skiatest::Reporter* reporter) { 17 DEF_TEST(FitsIn, reporter) {
17 TEST(int32_t, 1, int8_t, true); 18 TEST(int32_t, 1, int8_t, true);
18 TEST(int32_t, -1, int8_t, true); 19 TEST(int32_t, -1, int8_t, true);
19 TEST(int32_t, (int32_t)(std::numeric_limits<int8_t>::max)(), int8_t, tru e); 20 TEST(int32_t, (int32_t)(std::numeric_limits<int8_t>::max)(), int8_t, tru e);
20 TEST(int32_t, ((int32_t)(std::numeric_limits<int8_t>::max)())+1, int8_t, fal se); 21 TEST(int32_t, ((int32_t)(std::numeric_limits<int8_t>::max)())+1, int8_t, fal se);
21 TEST(int32_t, (int32_t)(std::numeric_limits<int8_t>::min)(), int8_t, tru e); 22 TEST(int32_t, (int32_t)(std::numeric_limits<int8_t>::min)(), int8_t, tru e);
22 TEST(int32_t, (int32_t)((std::numeric_limits<int8_t>::min)())-1, int8_t, fal se); 23 TEST(int32_t, (int32_t)((std::numeric_limits<int8_t>::min)())-1, int8_t, fal se);
23 24
24 TEST(int32_t, 1, uint8_t, true); 25 TEST(int32_t, 1, uint8_t, true);
25 TEST(int32_t, -1, uint8_t, false); 26 TEST(int32_t, -1, uint8_t, false);
26 TEST(int32_t, (int32_t)(std::numeric_limits<uint8_t>::max)(), uint8_t, t rue); 27 TEST(int32_t, (int32_t)(std::numeric_limits<uint8_t>::max)(), uint8_t, t rue);
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 TEST(uint64_t, 1, int8_t, true); 61 TEST(uint64_t, 1, int8_t, true);
61 TEST(uint64_t, 1, uint8_t, true); 62 TEST(uint64_t, 1, uint8_t, true);
62 TEST(uint64_t, 1, int32_t, true); 63 TEST(uint64_t, 1, int32_t, true);
63 TEST(uint64_t, 1, uint32_t, true); 64 TEST(uint64_t, 1, uint32_t, true);
64 TEST(uint64_t, 1, int64_t, true); 65 TEST(uint64_t, 1, int64_t, true);
65 TEST(uint64_t, 1, uint64_t, true); 66 TEST(uint64_t, 1, uint64_t, true);
66 67
67 // Uncommenting the following should cause compile failures. 68 // Uncommenting the following should cause compile failures.
68 //TEST(float, 1, uint64_t, true); 69 //TEST(float, 1, uint64_t, true);
69 } 70 }
70
71 #include "TestClassDef.h"
72 DEFINE_TESTCLASS("FitsIn", FitsInTestClass, FitsInTest)
OLDNEW
« no previous file with comments | « tests/FillPathTest.cpp ('k') | tests/FlatDataTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698