Flutter Engine
The Flutter Engine
Functions
SkSLTypeTest.cpp File Reference
#include "src/sksl/SkSLBuiltinTypes.h"
#include "src/sksl/ir/SkSLType.h"
#include "tests/Test.h"
#include <cstdint>
#include <limits>
#include <memory>

Go to the source code of this file.

Functions

 DEF_TEST (SkSLTypeLimits, r)
 

Function Documentation

◆ DEF_TEST()

DEF_TEST ( SkSLTypeLimits  ,
 
)

Definition at line 16 of file SkSLTypeTest.cpp.

16 {
18
19 using int_limits = std::numeric_limits<int32_t>;
20 REPORTER_ASSERT(r, types.fInt->minimumValue() == int_limits::lowest());
21 REPORTER_ASSERT(r, types.fInt->maximumValue() == int_limits::max());
22
23 using short_limits = std::numeric_limits<int16_t>;
24 REPORTER_ASSERT(r, types.fShort->minimumValue() == short_limits::lowest());
25 REPORTER_ASSERT(r, types.fShort->maximumValue() == short_limits::max());
26
27 using uint_limits = std::numeric_limits<uint32_t>;
28 REPORTER_ASSERT(r, types.fUInt->minimumValue() == uint_limits::lowest());
29 REPORTER_ASSERT(r, types.fUInt->maximumValue() == uint_limits::max());
30
31 using ushort_limits = std::numeric_limits<uint16_t>;
32 REPORTER_ASSERT(r, types.fUShort->minimumValue() == ushort_limits::lowest());
33 REPORTER_ASSERT(r, types.fUShort->maximumValue() == ushort_limits::max());
34
35 using float_limits = std::numeric_limits<float>;
36 REPORTER_ASSERT(r, types.fFloat->minimumValue() == float_limits::lowest());
37 REPORTER_ASSERT(r, types.fFloat->maximumValue() == float_limits::max());
38}
#define REPORTER_ASSERT(r, cond,...)
Definition: Test.h:286
const std::unique_ptr< Type > fUShort
const std::unique_ptr< Type > fInt
const std::unique_ptr< Type > fShort
const std::unique_ptr< Type > fUInt
const std::unique_ptr< Type > fFloat
static float max(float r, float g, float b)
Definition: hsl.cpp:49