MCPcopy Create free account
hub / github.com/apple/coremltools / testDouble

Method testDouble

deps/protobuf/php/tests/MapFieldTest.php:278–294  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

276 #########################################################
277
278 public function testDouble() {
279 $arr = new MapField(GPBType::INT32, GPBType::DOUBLE);
280
281 // Test set.
282 $arr[0] = 1;
283 $this->assertFloatEquals(1.0, $arr[0], MAX_FLOAT_DIFF);
284
285 $arr[1] = 1.1;
286 $this->assertFloatEquals(1.1, $arr[1], MAX_FLOAT_DIFF);
287
288 $arr[2] = '2';
289 $this->assertFloatEquals(2.0, $arr[2], MAX_FLOAT_DIFF);
290 $arr[3] = '3.1';
291 $this->assertFloatEquals(3.1, $arr[3], MAX_FLOAT_DIFF);
292
293 $this->assertEquals(4, count($arr));
294 }
295
296 #########################################################
297 # Test bool field.

Callers

nothing calls this directly

Calls 2

countFunction · 0.85
assertFloatEqualsMethod · 0.80

Tested by

no test coverage detected