MCPcopy Create free account
hub / github.com/RobTillaart/Arduino / unittest

Function unittest

libraries/ML8511/test/unit_test_001.cpp:55–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53
54
55unittest(test_constructor)
56{
57 ML8511 light(ANALOGPIN);
58
59 assertEqualFloat(5.0/1023, light.getVoltsPerStep(), 0.0001);
60 light.setVoltsPerStep(3.3, 4095);
61 assertEqualFloat(3.3/4095, light.getVoltsPerStep(), 0.0001);
62
63 light.reset();
64 assertEqualFloat(5.0/1023, light.getVoltsPerStep(), 0.0001);
65
66 assertTrue(light.isEnabled());
67 light.disable();
68 assertFalse(light.isEnabled());
69 light.enable();
70 assertTrue(light.isEnabled());
71}
72
73/*
74unittest(test_getUV)

Callers

nothing calls this directly

Calls 10

getVoltsPerStepMethod · 0.80
setVoltsPerStepMethod · 0.80
voltage2mWMethod · 0.80
setDUVfactorMethod · 0.80
getDUVfactorMethod · 0.80
estimateDUVindexMethod · 0.80
resetMethod · 0.45
isEnabledMethod · 0.45
disableMethod · 0.45
enableMethod · 0.45

Tested by

no test coverage detected