Flutter Engine
The Flutter Engine
SkColor4fTest.cpp
Go to the documentation of this file.
1/*
2 * Copyright 2016 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
9#include "tests/Test.h"
10
11DEF_TEST(SkColor4f_FromColor, reporter) {
12 const struct {
13 SkColor fC;
14 SkColor4f fC4;
15 } recs[] = {
16 { SK_ColorBLACK, { 0, 0, 0, 1 } },
17 { SK_ColorWHITE, { 1, 1, 1, 1 } },
18 { SK_ColorRED, { 1, 0, 0, 1 } },
19 { SK_ColorGREEN, { 0, 1, 0, 1 } },
20 { SK_ColorBLUE, { 0, 0, 1, 1 } },
21 { 0, { 0, 0, 0, 0 } },
22 };
23
24 for (const auto& r : recs) {
25 SkColor4f c4 = SkColor4f::FromColor(r.fC);
26 REPORTER_ASSERT(reporter, c4 == r.fC4);
27 }
28}
reporter
Definition: FontMgrTest.cpp:39
DEF_TEST(SkColor4f_FromColor, reporter)
uint32_t SkColor
Definition: SkColor.h:37
constexpr SkColor SK_ColorBLUE
Definition: SkColor.h:135
constexpr SkColor SK_ColorRED
Definition: SkColor.h:126
constexpr SkColor SK_ColorBLACK
Definition: SkColor.h:103
constexpr SkColor SK_ColorGREEN
Definition: SkColor.h:131
constexpr SkColor SK_ColorWHITE
Definition: SkColor.h:122
#define REPORTER_ASSERT(r, cond,...)
Definition: Test.h:286