func TestDPT_9008(t *testing.T) {
	var buf []byte
	var src, dst DPT_9008
	for i := 1; i <= 10; i++ {
		value := rand.Float32()
		value *= 670760
		Q := get_float_quantization_error(value, 0.01, 2047)
		src = DPT_9008(value)
		if abs(float32(src)-value) > epsilon {
			t.Errorf("Assignment of value \"%v\" failed for source of type DPT_9008! 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 9.008 (Air quality) with values within range
package dpt
import (
	"testing"
	"math"
	"math/rand"
)
func TestDPT_9001(t *testing.T) {
	var buf []byte
	var src, dst DPT_9001
	for i := 1; i <= 10; i++ {
		value := rand.Float32()
		value *= 670760 - -273
		value += -273
		Q := get_float_quantization_error(value, 0.01, 2047)
		src = DPT_9001(value)
		if abs(float32(src)-value) > epsilon {
			t.Errorf("Assignment of value \"%v\" failed for source of type DPT_9001! 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_9002(t *testing.T) {
	var buf []byte
	var src, dst DPT_9002
	for i := 1; i <= 10; i++ {
		value := rand.Float32()
		value *= 670760 - -670760
		value += -670760
		Q := get_float_quantization_error(value, 0.01, 2047)
		src = DPT_9002(value)
		if abs(float32(src)-value) > epsilon {
			t.Errorf("Assignment of value \"%v\" failed for source of type DPT_9002! 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_9003(t *testing.T) {
	var buf []byte
	var src, dst DPT_9003
	for i := 1; i <= 10; i++ {
		value := rand.Float32()
		value *= 670760 - -670760
		value += -670760
		Q := get_float_quantization_error(value, 0.01, 2047)
		src = DPT_9003(value)
		if abs(float32(src)-value) > epsilon {
			t.Errorf("Assignment of value \"%v\" failed for source of type DPT_9003! 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_9004(t *testing.T) {
	var buf []byte
	var src, dst DPT_9004
	for i := 1; i <= 10; i++ {
		value := rand.Float32()
		value *= 670760
		Q := get_float_quantization_error(value, 0.01, 2047)
		src = DPT_9004(value)
		if abs(float32(src)-value) > epsilon {
			t.Errorf("Assignment of value \"%v\" failed for source of type DPT_9004! 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_9005(t *testing.T) {
	var buf []byte
	var src, dst DPT_9005
	for i := 1; i <= 10; i++ {
		value := rand.Float32()
		value *= 670760
		Q := get_float_quantization_error(value, 0.01, 2047)
		src = DPT_9005(value)
		if abs(float32(src)-value) > epsilon {
			t.Errorf("Assignment of value \"%v\" failed for source of type DPT_9005! 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_9006(t *testing.T) {
	var buf []byte
	var src, dst DPT_9006
	for i := 1; i <= 10; i++ {
		value := rand.Float32()
		value *= 670760
		Q := get_float_quantization_error(value, 0.01, 2047)
		src = DPT_9006(value)
		if abs(float32(src)-value) > epsilon {
			t.Errorf("Assignment of value \"%v\" failed for source of type DPT_9006! 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_9007(t *testing.T) {
	var buf []byte
	var src, dst DPT_9007
	for i := 1; i <= 10; i++ {
		value := rand.Float32()
		value *= 670760
		Q := get_float_quantization_error(value, 0.01, 2047)
		src = DPT_9007(value)
		if abs(float32(src)-value) > epsilon {
			t.Errorf("Assignment of value \"%v\" failed for source of type DPT_9007! 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)
		}
	}
}