func TestDPT_14018(t *testing.T) {
	var buf []byte
	var src, dst DPT_14018
	for i := 1; i <= 10; i++ {
		value, Q := getRandValue()
		src = DPT_14018(value)
		if abs(float32(src)-value) > epsilon {
			t.Errorf("Assignment of value \"%v\" failed for source of type DPT_14018! 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.018 (Electric Charge) 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)
		}
	}
}
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)
		}
	}
}
func TestDPT_14003(t *testing.T) {
	var buf []byte
	var src, dst DPT_14003
	for i := 1; i <= 10; i++ {
		value, Q := getRandValue()
		src = DPT_14003(value)
		if abs(float32(src)-value) > epsilon {
			t.Errorf("Assignment of value \"%v\" failed for source of type DPT_14003! 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_14004(t *testing.T) {
	var buf []byte
	var src, dst DPT_14004
	for i := 1; i <= 10; i++ {
		value, Q := getRandValue()
		src = DPT_14004(value)
		if abs(float32(src)-value) > epsilon {
			t.Errorf("Assignment of value \"%v\" failed for source of type DPT_14004! 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_14005(t *testing.T) {
	var buf []byte
	var src, dst DPT_14005
	for i := 1; i <= 10; i++ {
		value, Q := getRandValue()
		src = DPT_14005(value)
		if abs(float32(src)-value) > epsilon {
			t.Errorf("Assignment of value \"%v\" failed for source of type DPT_14005! 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_14006(t *testing.T) {
	var buf []byte
	var src, dst DPT_14006
	for i := 1; i <= 10; i++ {
		value, Q := getRandValue()
		src = DPT_14006(value)
		if abs(float32(src)-value) > epsilon {
			t.Errorf("Assignment of value \"%v\" failed for source of type DPT_14006! 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_14007(t *testing.T) {
	var buf []byte
	var src, dst DPT_14007
	for i := 1; i <= 10; i++ {
		value, Q := getRandValue()
		src = DPT_14007(value)
		if abs(float32(src)-value) > epsilon {
			t.Errorf("Assignment of value \"%v\" failed for source of type DPT_14007! 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_14008(t *testing.T) {
	var buf []byte
	var src, dst DPT_14008
	for i := 1; i <= 10; i++ {
		value, Q := getRandValue()
		src = DPT_14008(value)
		if abs(float32(src)-value) > epsilon {
			t.Errorf("Assignment of value \"%v\" failed for source of type DPT_14008! 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_14009(t *testing.T) {
	var buf []byte
	var src, dst DPT_14009
	for i := 1; i <= 10; i++ {
		value, Q := getRandValue()
		src = DPT_14009(value)
		if abs(float32(src)-value) > epsilon {
			t.Errorf("Assignment of value \"%v\" failed for source of type DPT_14009! 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_14010(t *testing.T) {
	var buf []byte
	var src, dst DPT_14010
	for i := 1; i <= 10; i++ {
		value, Q := getRandValue()
		src = DPT_14010(value)
		if abs(float32(src)-value) > epsilon {
			t.Errorf("Assignment of value \"%v\" failed for source of type DPT_14010! 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_14011(t *testing.T) {
	var buf []byte
	var src, dst DPT_14011
	for i := 1; i <= 10; i++ {
		value, Q := getRandValue()
		src = DPT_14011(value)
		if abs(float32(src)-value) > epsilon {
			t.Errorf("Assignment of value \"%v\" failed for source of type DPT_14011! 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_14012(t *testing.T) {
	var buf []byte
	var src, dst DPT_14012
	for i := 1; i <= 10; i++ {
		value, Q := getRandValue()
		src = DPT_14012(value)
		if abs(float32(src)-value) > epsilon {
			t.Errorf("Assignment of value \"%v\" failed for source of type DPT_14012! 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_14013(t *testing.T) {
	var buf []byte
	var src, dst DPT_14013
	for i := 1; i <= 10; i++ {
		value, Q := getRandValue()
		src = DPT_14013(value)
		if abs(float32(src)-value) > epsilon {
			t.Errorf("Assignment of value \"%v\" failed for source of type DPT_14013! 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_14014(t *testing.T) {
	var buf []byte
	var src, dst DPT_14014
	for i := 1; i <= 10; i++ {
		value, Q := getRandValue()
		src = DPT_14014(value)
		if abs(float32(src)-value) > epsilon {
			t.Errorf("Assignment of value \"%v\" failed for source of type DPT_14014! 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_14015(t *testing.T) {
	var buf []byte
	var src, dst DPT_14015
	for i := 1; i <= 10; i++ {
		value, Q := getRandValue()
		src = DPT_14015(value)
		if abs(float32(src)-value) > epsilon {
			t.Errorf("Assignment of value \"%v\" failed for source of type DPT_14015! 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_14016(t *testing.T) {
	var buf []byte
	var src, dst DPT_14016
	for i := 1; i <= 10; i++ {
		value, Q := getRandValue()
		src = DPT_14016(value)
		if abs(float32(src)-value) > epsilon {
			t.Errorf("Assignment of value \"%v\" failed for source of type DPT_14016! 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_14017(t *testing.T) {
	var buf []byte
	var src, dst DPT_14017
	for i := 1; i <= 10; i++ {
		value, Q := getRandValue()
		src = DPT_14017(value)
		if abs(float32(src)-value) > epsilon {
			t.Errorf("Assignment of value \"%v\" failed for source of type DPT_14017! 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)
		}
	}
}