Flutter Engine
The Flutter Engine
SkEnumBitMaskTest.cpp
Go to the documentation of this file.
1/*
2 * Copyright 2019 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
11enum class Flags {
12 kNone = 0,
13 kA = 1,
14 kB = 2,
15 kC = 4
16};
18
19DEF_TEST(skgpu_Mask, r) {
27 auto mask = Flags::kB | Flags::kC;
28 REPORTER_ASSERT(r, (flags & mask) == mask);
30 flags &= ~Flags::kC;
32 REPORTER_ASSERT(r, (flags & mask) != mask);
33 REPORTER_ASSERT(r, (flags & mask) != Flags::kNone);
34 REPORTER_ASSERT(r, (flags & mask));
36 flags &= ~Flags::kB;
37 REPORTER_ASSERT(r, (flags & mask) == Flags::kNone);
38 REPORTER_ASSERT(r, !(flags & mask));
40 flags = (flags | flags) ^ (flags);
42 flags ^= mask;
43 REPORTER_ASSERT(r, flags == mask);
46}
DEF_TEST(skgpu_Mask, r)
#define SK_MAKE_BITMASK_OPS(E)
Definition: SkEnumBitMask.h:68
#define REPORTER_ASSERT(r, cond,...)
Definition: Test.h:286
FlutterSemanticsFlag flags