func TestDPT_14002(t *testing.T) {
	var buf []byte
	var src, dst DPT_14002
	for i := 1; i <= 10; i++ {
		value, Q := getRandValue()
		src = DPT_14002(value)
		if abs(float32(src)-value) > epsilon {
			t.Errorf("Assignment of value \"%v\" failed for source of type DPT_14002! Has value \"%s\".", value, src)
		}
		buf = src.Pack()
		_ = dst.Unpack(buf)
		if math.IsNaN(float64(dst)) {
			t.Errorf("Value \"%s\" is not a valid number! Original value was \"%v\".", dst, value)
		}
		if abs(float32(dst)-value) > (Q + epsilon) {
			t.Errorf("Value \"%s\" after pack/unpack above quantization noise! Original value was \"%v\", noise is \"%f\"", dst, value, Q)
		}
	}
}
Test DPT 14.002 (ActivationEnergy) with values within range
package dpt
import (
	"testing"
	"math"
	"math/rand"
)
func getRandValue() (float32, float32) {
	value := rand.Float32()
	value *= 670760
	Q := get_float_quantization_error(value, 0.01, 2047)
	return value, Q
}
func TestDPT_14000(t *testing.T) {
	var buf []byte
	var src, dst DPT_14000
	for i := 1; i <= 10; i++ {
		value, Q := getRandValue()
		src = DPT_14000(value)
		if abs(float32(src)-value) > epsilon {
			t.Errorf("Assignment of value \"%v\" failed for source of type DPT_14000! Has value \"%s\".", value, src)
		}
		buf = src.Pack()
		_ = dst.Unpack(buf)
		if math.IsNaN(float64(dst)) {
			t.Errorf("Value \"%s\" is not a valid number! Original value was \"%v\".", dst, value)
		}
		if abs(float32(dst)-value) > (Q + epsilon) {
			t.Errorf("Value \"%s\" after pack/unpack above quantization noise! Original value was \"%v\", noise is \"%f\"", dst, value, Q)
		}
	}
}
func TestDPT_14001(t *testing.T) {
	var buf []byte
	var src, dst DPT_14001
	for i := 1; i <= 10; i++ {
		value, Q := getRandValue()
		src = DPT_14001(value)
		if abs(float32(src)-value) > epsilon {
			t.Errorf("Assignment of value \"%v\" failed for source of type DPT_14001! Has value \"%s\".", value, src)
		}
		buf = src.Pack()
		_ = dst.Unpack(buf)
		if math.IsNaN(float64(dst)) {
			t.Errorf("Value \"%s\" is not a valid number! Original value was \"%v\".", dst, value)
		}
		if abs(float32(dst)-value) > (Q + epsilon) {
			t.Errorf("Value \"%s\" after pack/unpack above quantization noise! Original value was \"%v\", noise is \"%f\"", dst, value, Q)
		}
	}
}