MCPcopy Create free account
hub / github.com/couchbase/fleece / checkReadU

Method checkReadU

Tests/EncoderTests.cc:91–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89 }
90
91 void checkReadU(uint64_t i) {
92 auto v = Value::fromData(result);
93 if (!v || v->type() != kNumber || !v->isInteger() || v->asUnsigned() != i || v->asDouble() != (double)i) {
94 REQUIRE(v != nullptr);
95 REQUIRE(v->type() == kNumber);
96 REQUIRE(v->isInteger());
97 REQUIRE(v->asUnsigned() == i);
98 REQUIRE(v->asDouble() == (double)i);
99 }
100 if (i >= (UINT64_MAX >> 1))
101 REQUIRE(v->isUnsigned());
102 }
103
104 void checkReadFloat(float f) {
105 auto v = Value::fromData(result);

Callers

nothing calls this directly

Calls 5

typeMethod · 0.45
isIntegerMethod · 0.45
asUnsignedMethod · 0.45
asDoubleMethod · 0.45
isUnsignedMethod · 0.45

Tested by

no test coverage detected