#include <stdio.h>
#include <string.h>
#include <float.h>
#include <math.h>
#include <errno.h>

#include <munit/munit.h>

#include <value.h>


MunitResult
test_value_cast(const MunitParameter Parameters[], void *Fixture) {
    VALUE sCopy, sValue;

    errno = 0;
    munit_assert_int(value_cast(NULL, TYPE_NONE), ==, -1);
    munit_assert_int(errno, ==, EINVAL);

    value_initialise(&sValue);
    value_assign(&sValue, TYPE_LINT, -1);
    munit_assert_uint32(sValue.Type, ==, TYPE_LINT);
    munit_assert_uint32(sValue.Flags, ==, FLAG_NONE);
    munit_assert_int64(sValue.Value.S64, ==, (int64_t) -1);
    munit_assert_int(value_cast(&sValue, TYPE_LINT, NULL), ==, 0);
    value_initialise(&sCopy);
    munit_assert_uint32(sCopy.Type, ==, TYPE_NONE);
    munit_assert_uint32(sCopy.Flags, ==, FLAG_NONE);
    munit_assert_int(value_cast(&sCopy, TYPE_SINT, &sValue), ==, 0);
    munit_assert_uint32(sCopy.Type, ==, TYPE_SINT);
    munit_assert_uint32(sCopy.Flags, ==, FLAG_NONE);
    munit_assert_int8(sValue.Value.S8, ==, -1);
    munit_assert_int(value_cast(&sCopy, TYPE_SINT), ==, 0);
    munit_assert_uint32(sCopy.Type, ==, TYPE_SINT);
    munit_assert_int(value_cast(&sCopy, TYPE_NONE), ==, 0);
    munit_assert_uint32(sCopy.Type, ==, TYPE_SINT);
    value_destroy(&sCopy);
    value_destroy(&sValue);

    //  TYPE_LREAL
    value_initialise(&sValue);
    value_assign(&sValue, TYPE_LREAL, -1.0);
    munit_assert_int(value_cast(&sValue, TYPE_LREAL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LREAL);
    munit_assert_size(sValue.Length, ==, sizeof(double));
    munit_assert_double(sValue.Maximum.Double, ==, DBL_MAX);
    munit_assert_double(sValue.Minimum.Double, ==, DBL_MIN);
    munit_assert_double(sValue.Value.Double, ==, -1.0);
    value_assign(&sValue, TYPE_LREAL, -1.0);
    munit_assert_int(value_cast(&sValue, TYPE_REAL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_REAL);
    munit_assert_size(sValue.Length, ==, sizeof(float));
    munit_assert_float(sValue.Maximum.Single, ==, FLT_MAX);
    munit_assert_float(sValue.Minimum.Single, ==, FLT_MIN);
    munit_assert_float(sValue.Value.Single, ==, -1.0f);
    value_assign(&sValue, TYPE_LREAL, -1.0);
    munit_assert_int(value_cast(&sValue, TYPE_LINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LINT);
    munit_assert_size(sValue.Length, ==, sizeof(int64_t));
    munit_assert_int64(sValue.Maximum.S64, ==, INT64_MAX);
    munit_assert_int64(sValue.Minimum.S64, ==, INT64_MIN);
    munit_assert_int64(sValue.Value.S64, ==, -1);
    value_assign(&sValue, TYPE_LREAL, -1.0);
    munit_assert_int(value_cast(&sValue, TYPE_DINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DINT);
    munit_assert_size(sValue.Length, ==, sizeof(int32_t));
    munit_assert_int32(sValue.Maximum.S32, ==, INT32_MAX);
    munit_assert_int32(sValue.Minimum.S32, ==, INT32_MIN);
    munit_assert_int32(sValue.Value.S32, ==, -1);
    value_assign(&sValue, TYPE_LREAL, -1.0);
    munit_assert_int(value_cast(&sValue, TYPE_INT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_INT);
    munit_assert_size(sValue.Length, ==, sizeof(int16_t));
    munit_assert_int16(sValue.Maximum.S16, ==, INT16_MAX);
    munit_assert_int16(sValue.Minimum.S16, ==, INT16_MIN);
    munit_assert_int16(sValue.Value.S16, ==, -1);
    value_assign(&sValue, TYPE_LREAL, -1.0);
    munit_assert_int(value_cast(&sValue, TYPE_SINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_SINT);
    munit_assert_size(sValue.Length, ==, sizeof(int8_t));
    munit_assert_int8(sValue.Maximum.S8, ==, INT8_MAX);
    munit_assert_int8(sValue.Minimum.S8, ==, INT8_MIN);
    munit_assert_int8(sValue.Value.S8, ==, -1);
    value_assign(&sValue, TYPE_LREAL, 1.0);
    munit_assert_int(value_cast(&sValue, TYPE_ULINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_ULINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint64_t));
    munit_assert_uint64(sValue.Maximum.U64, ==, UINT64_MAX);
    munit_assert_uint64(sValue.Minimum.U64, ==, 0);
    munit_assert_uint64(sValue.Value.U64, ==, 1);
    value_assign(&sValue, TYPE_LREAL, 1.0);
    munit_assert_int(value_cast(&sValue, TYPE_UDINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_UDINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint32_t));
    munit_assert_uint32(sValue.Maximum.U32, ==, UINT32_MAX);
    munit_assert_uint32(sValue.Minimum.U32, ==, 0);
    munit_assert_uint32(sValue.Value.U32, ==, 1);
    value_assign(&sValue, TYPE_LREAL, 1.0);
    munit_assert_int(value_cast(&sValue, TYPE_UINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_UINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint16_t));
    munit_assert_uint16(sValue.Maximum.U16, ==, UINT16_MAX);
    munit_assert_uint16(sValue.Minimum.U16, ==, 0);
    munit_assert_uint16(sValue.Value.U16, ==, 1);
    value_assign(&sValue, TYPE_LREAL, 1.0);
    munit_assert_int(value_cast(&sValue, TYPE_USINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_USINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.U8, ==, UINT8_MAX);
    munit_assert_uint8(sValue.Minimum.U8, ==, 0);
    munit_assert_uint8(sValue.Value.U8, ==, 1);
    value_assign(&sValue, TYPE_LREAL, 1.0);
    munit_assert_int(value_cast(&sValue, TYPE_LWORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LWORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint64_t));
    munit_assert_uint64(sValue.Maximum.B64, ==, UINT64_MAX);
    munit_assert_uint64(sValue.Minimum.B64, ==, 0);
    munit_assert_uint64(sValue.Value.B64, ==, 1);
    value_assign(&sValue, TYPE_LREAL, 1.0);
    munit_assert_int(value_cast(&sValue, TYPE_DWORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DWORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint32_t));
    munit_assert_uint32(sValue.Maximum.B32, ==, UINT32_MAX);
    munit_assert_uint32(sValue.Minimum.B32, ==, 0);
    munit_assert_uint32(sValue.Value.B32, ==, 1);
    value_assign(&sValue, TYPE_LREAL, 1.0);
    munit_assert_int(value_cast(&sValue, TYPE_WORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_WORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint16_t));
    munit_assert_uint16(sValue.Maximum.B16, ==, UINT16_MAX);
    munit_assert_uint16(sValue.Minimum.B16, ==, 0);
    munit_assert_uint16(sValue.Value.B16, ==, 1);
    value_assign(&sValue, TYPE_LREAL, 1.0);
    munit_assert_int(value_cast(&sValue, TYPE_BYTE), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_BYTE);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.B8, ==, UINT8_MAX);
    munit_assert_uint8(sValue.Minimum.B8, ==, 0);
    munit_assert_uint8(sValue.Value.B8, ==, 1);
    value_assign(&sValue, TYPE_LREAL, 1.0);
    munit_assert_int(value_cast(&sValue, TYPE_BOOL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_BOOL);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.B1, ==, 1);
    munit_assert_uint8(sValue.Minimum.B1, ==, 0);
    munit_assert_uint8(sValue.Value.B1, ==, 1);
    value_assign(&sValue, TYPE_LREAL, 1.0);
    munit_assert_int(value_cast(&sValue, TYPE_TIME), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_TIME);
    munit_assert_size(sValue.Length, ==, sizeof(float));
    munit_assert_float(sValue.Maximum.Time, ==, FLT_MAX);
    munit_assert_float(sValue.Minimum.Time, ==, FLT_MIN);
    munit_assert_float(sValue.Value.Time, ==, 1.0);
    value_assign(&sValue, TYPE_LREAL, 1.0);
    munit_assert_int(value_cast(&sValue, TYPE_DATE), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DATE);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_assign(&sValue, TYPE_LREAL, 1.0);
    munit_assert_int(value_cast(&sValue, TYPE_DT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DT);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_assign(&sValue, TYPE_LREAL, 1.0);
    munit_assert_int(value_cast(&sValue, TYPE_TOD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_TOD);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_destroy(&sValue);

    //  TYPE_REAL
    value_initialise(&sValue);
    value_assign(&sValue, TYPE_REAL, -1.0);
    munit_assert_int(value_cast(&sValue, TYPE_LREAL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LREAL);
    munit_assert_size(sValue.Length, ==, sizeof(double));
    munit_assert_double(sValue.Maximum.Double, ==, DBL_MAX);
    munit_assert_double(sValue.Minimum.Double, ==, DBL_MIN);
    munit_assert_double(sValue.Value.Double, ==, -1.0);
    value_assign(&sValue, TYPE_REAL, -1.0);
    munit_assert_int(value_cast(&sValue, TYPE_REAL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_REAL);
    munit_assert_size(sValue.Length, ==, sizeof(float));
    munit_assert_float(sValue.Maximum.Single, ==, FLT_MAX);
    munit_assert_float(sValue.Minimum.Single, ==, FLT_MIN);
    munit_assert_float(sValue.Value.Single, ==, -1.0f);
    value_assign(&sValue, TYPE_REAL, -1.0);
    munit_assert_int(value_cast(&sValue, TYPE_LINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LINT);
    munit_assert_size(sValue.Length, ==, sizeof(int64_t));
    munit_assert_int64(sValue.Maximum.S64, ==, INT64_MAX);
    munit_assert_int64(sValue.Minimum.S64, ==, INT64_MIN);
    munit_assert_int64(sValue.Value.S64, ==, -1);
    value_assign(&sValue, TYPE_REAL, -1.0);
    munit_assert_int(value_cast(&sValue, TYPE_DINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DINT);
    munit_assert_size(sValue.Length, ==, sizeof(int32_t));
    munit_assert_int32(sValue.Maximum.S32, ==, INT32_MAX);
    munit_assert_int32(sValue.Minimum.S32, ==, INT32_MIN);
    munit_assert_int32(sValue.Value.S32, ==, -1);
    value_assign(&sValue, TYPE_REAL, -1.0);
    munit_assert_int(value_cast(&sValue, TYPE_INT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_INT);
    munit_assert_size(sValue.Length, ==, sizeof(int16_t));
    munit_assert_int16(sValue.Maximum.S16, ==, INT16_MAX);
    munit_assert_int16(sValue.Minimum.S16, ==, INT16_MIN);
    munit_assert_int16(sValue.Value.S16, ==, -1);
    value_assign(&sValue, TYPE_REAL, -1.0);
    munit_assert_int(value_cast(&sValue, TYPE_SINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_SINT);
    munit_assert_size(sValue.Length, ==, sizeof(int8_t));
    munit_assert_int8(sValue.Maximum.S8, ==, INT8_MAX);
    munit_assert_int8(sValue.Minimum.S8, ==, INT8_MIN);
    munit_assert_int8(sValue.Value.S8, ==, -1);
    value_assign(&sValue, TYPE_REAL, 1.0);
    munit_assert_int(value_cast(&sValue, TYPE_ULINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_ULINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint64_t));
    munit_assert_uint64(sValue.Maximum.U64, ==, UINT64_MAX);
    munit_assert_uint64(sValue.Minimum.U64, ==, 0);
    munit_assert_uint64(sValue.Value.U64, ==, 1);
    value_assign(&sValue, TYPE_REAL, 1.0);
    munit_assert_int(value_cast(&sValue, TYPE_UDINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_UDINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint32_t));
    munit_assert_uint32(sValue.Maximum.U32, ==, UINT32_MAX);
    munit_assert_uint32(sValue.Minimum.U32, ==, 0);
    munit_assert_uint32(sValue.Value.U32, ==, 1);
    value_assign(&sValue, TYPE_REAL, 1.0);
    munit_assert_int(value_cast(&sValue, TYPE_UINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_UINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint16_t));
    munit_assert_uint16(sValue.Maximum.U16, ==, UINT16_MAX);
    munit_assert_uint16(sValue.Minimum.U16, ==, 0);
    munit_assert_uint16(sValue.Value.U16, ==, 1);
    value_assign(&sValue, TYPE_REAL, 1.0);
    munit_assert_int(value_cast(&sValue, TYPE_USINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_USINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.U8, ==, UINT8_MAX);
    munit_assert_uint8(sValue.Minimum.U8, ==, 0);
    munit_assert_uint8(sValue.Value.U8, ==, 1);
    value_assign(&sValue, TYPE_REAL, 1.0);
    munit_assert_int(value_cast(&sValue, TYPE_LWORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LWORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint64_t));
    munit_assert_uint64(sValue.Maximum.B64, ==, UINT64_MAX);
    munit_assert_uint64(sValue.Minimum.B64, ==, 0);
    munit_assert_uint64(sValue.Value.B64, ==, 1);
    value_assign(&sValue, TYPE_REAL, 1.0);
    munit_assert_int(value_cast(&sValue, TYPE_DWORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DWORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint32_t));
    munit_assert_uint32(sValue.Maximum.B32, ==, UINT32_MAX);
    munit_assert_uint32(sValue.Minimum.B32, ==, 0);
    munit_assert_uint32(sValue.Value.B32, ==, 1);
    value_assign(&sValue, TYPE_REAL, 1.0);
    munit_assert_int(value_cast(&sValue, TYPE_WORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_WORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint16_t));
    munit_assert_uint16(sValue.Maximum.B16, ==, UINT16_MAX);
    munit_assert_uint16(sValue.Minimum.B16, ==, 0);
    munit_assert_uint16(sValue.Value.B16, ==, 1);
    value_assign(&sValue, TYPE_REAL, 1.0);
    munit_assert_int(value_cast(&sValue, TYPE_BYTE), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_BYTE);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.B8, ==, UINT8_MAX);
    munit_assert_uint8(sValue.Minimum.B8, ==, 0);
    munit_assert_uint8(sValue.Value.B8, ==, 1);
    value_assign(&sValue, TYPE_REAL, 1.0);
    munit_assert_int(value_cast(&sValue, TYPE_BOOL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_BOOL);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.B1, ==, 1);
    munit_assert_uint8(sValue.Minimum.B1, ==, 0);
    munit_assert_uint8(sValue.Value.B1, ==, 1);
    value_assign(&sValue, TYPE_REAL, 1.0);
    munit_assert_int(value_cast(&sValue, TYPE_TIME), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_TIME);
    munit_assert_size(sValue.Length, ==, sizeof(float));
    munit_assert_float(sValue.Maximum.Time, ==, FLT_MAX);
    munit_assert_float(sValue.Minimum.Time, ==, FLT_MIN);
    munit_assert_float(sValue.Value.Time, ==, 1.0);
    value_assign(&sValue, TYPE_REAL, 1.0);
    munit_assert_int(value_cast(&sValue, TYPE_DATE), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DATE);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_assign(&sValue, TYPE_REAL, 1.0);
    munit_assert_int(value_cast(&sValue, TYPE_DT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DT);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_assign(&sValue, TYPE_REAL, 1.0);
    munit_assert_int(value_cast(&sValue, TYPE_TOD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_TOD);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_destroy(&sValue);

    //  TYPE_LINT
    value_initialise(&sValue);
    value_assign(&sValue, TYPE_LINT, -1);
    munit_assert_int(value_cast(&sValue, TYPE_LREAL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LREAL);
    munit_assert_size(sValue.Length, ==, sizeof(double));
    munit_assert_double(sValue.Maximum.Double, ==, DBL_MAX);
    munit_assert_double(sValue.Minimum.Double, ==, DBL_MIN);
    munit_assert_double(sValue.Value.Double, ==, -1.0);
    value_assign(&sValue, TYPE_LINT, -1);
    munit_assert_int(value_cast(&sValue, TYPE_REAL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_REAL);
    munit_assert_size(sValue.Length, ==, sizeof(float));
    munit_assert_float(sValue.Maximum.Single, ==, FLT_MAX);
    munit_assert_float(sValue.Minimum.Single, ==, FLT_MIN);
    munit_assert_float(sValue.Value.Single, ==, -1.0f);
    value_assign(&sValue, TYPE_LINT, -1);
    munit_assert_int(value_cast(&sValue, TYPE_LINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LINT);
    munit_assert_size(sValue.Length, ==, sizeof(int64_t));
    munit_assert_int64(sValue.Maximum.S64, ==, INT64_MAX);
    munit_assert_int64(sValue.Minimum.S64, ==, INT64_MIN);
    munit_assert_int64(sValue.Value.S64, ==, -1);
    value_assign(&sValue, TYPE_LINT, -1);
    munit_assert_int(value_cast(&sValue, TYPE_DINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DINT);
    munit_assert_size(sValue.Length, ==, sizeof(int32_t));
    munit_assert_int32(sValue.Maximum.S32, ==, INT32_MAX);
    munit_assert_int32(sValue.Minimum.S32, ==, INT32_MIN);
    munit_assert_int32(sValue.Value.S32, ==, -1);
    value_assign(&sValue, TYPE_LINT, -1);
    munit_assert_int(value_cast(&sValue, TYPE_INT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_INT);
    munit_assert_size(sValue.Length, ==, sizeof(int16_t));
    munit_assert_int16(sValue.Maximum.S16, ==, INT16_MAX);
    munit_assert_int16(sValue.Minimum.S16, ==, INT16_MIN);
    munit_assert_int16(sValue.Value.S16, ==, -1);
    value_assign(&sValue, TYPE_LINT, -1);
    munit_assert_int(value_cast(&sValue, TYPE_SINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_SINT);
    munit_assert_size(sValue.Length, ==, sizeof(int8_t));
    munit_assert_int8(sValue.Maximum.S8, ==, INT8_MAX);
    munit_assert_int8(sValue.Minimum.S8, ==, INT8_MIN);
    munit_assert_int8(sValue.Value.S8, ==, -1);
    value_assign(&sValue, TYPE_LINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_ULINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_ULINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint64_t));
    munit_assert_uint64(sValue.Maximum.U64, ==, UINT64_MAX);
    munit_assert_uint64(sValue.Minimum.U64, ==, 0);
    munit_assert_uint64(sValue.Value.U64, ==, 1);
    value_assign(&sValue, TYPE_LINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_UDINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_UDINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint32_t));
    munit_assert_uint32(sValue.Maximum.U32, ==, UINT32_MAX);
    munit_assert_uint32(sValue.Minimum.U32, ==, 0);
    munit_assert_uint32(sValue.Value.U32, ==, 1);
    value_assign(&sValue, TYPE_LINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_UINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_UINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint16_t));
    munit_assert_uint16(sValue.Maximum.U16, ==, UINT16_MAX);
    munit_assert_uint16(sValue.Minimum.U16, ==, 0);
    munit_assert_uint16(sValue.Value.U16, ==, 1);
    value_assign(&sValue, TYPE_LINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_USINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_USINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.U8, ==, UINT8_MAX);
    munit_assert_uint8(sValue.Minimum.U8, ==, 0);
    munit_assert_uint8(sValue.Value.U8, ==, 1);
    value_assign(&sValue, TYPE_LINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_LWORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LWORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint64_t));
    munit_assert_uint64(sValue.Maximum.B64, ==, UINT64_MAX);
    munit_assert_uint64(sValue.Minimum.B64, ==, 0);
    munit_assert_uint64(sValue.Value.B64, ==, 1);
    value_assign(&sValue, TYPE_LINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DWORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DWORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint32_t));
    munit_assert_uint32(sValue.Maximum.B32, ==, UINT32_MAX);
    munit_assert_uint32(sValue.Minimum.B32, ==, 0);
    munit_assert_uint32(sValue.Value.B32, ==, 1);
    value_assign(&sValue, TYPE_LINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_WORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_WORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint16_t));
    munit_assert_uint16(sValue.Maximum.B16, ==, UINT16_MAX);
    munit_assert_uint16(sValue.Minimum.B16, ==, 0);
    munit_assert_uint16(sValue.Value.B16, ==, 1);
    value_assign(&sValue, TYPE_LINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_BYTE), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_BYTE);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.B8, ==, UINT8_MAX);
    munit_assert_uint8(sValue.Minimum.B8, ==, 0);
    munit_assert_uint8(sValue.Value.B8, ==, 1);
    value_assign(&sValue, TYPE_LINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_BOOL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_BOOL);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.B1, ==, 1);
    munit_assert_uint8(sValue.Minimum.B1, ==, 0);
    munit_assert_uint8(sValue.Value.B1, ==, 1);
    value_assign(&sValue, TYPE_LINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_TIME), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_TIME);
    munit_assert_size(sValue.Length, ==, sizeof(float));
    munit_assert_float(sValue.Maximum.Time, ==, FLT_MAX);
    munit_assert_float(sValue.Minimum.Time, ==, FLT_MIN);
    munit_assert_float(sValue.Value.Time, ==, 1.0);
    value_assign(&sValue, TYPE_LINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DATE), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DATE);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_assign(&sValue, TYPE_LINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DT);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_assign(&sValue, TYPE_LINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_TOD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_TOD);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_destroy(&sValue);

    //  TYPE_DINT
    value_initialise(&sValue);
    value_assign(&sValue, TYPE_DINT, -1);
    munit_assert_int(value_cast(&sValue, TYPE_LREAL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LREAL);
    munit_assert_size(sValue.Length, ==, sizeof(double));
    munit_assert_double(sValue.Maximum.Double, ==, DBL_MAX);
    munit_assert_double(sValue.Minimum.Double, ==, DBL_MIN);
    munit_assert_double(sValue.Value.Double, ==, -1.0);
    value_assign(&sValue, TYPE_DINT, -1);
    munit_assert_int(value_cast(&sValue, TYPE_REAL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_REAL);
    munit_assert_size(sValue.Length, ==, sizeof(float));
    munit_assert_float(sValue.Maximum.Single, ==, FLT_MAX);
    munit_assert_float(sValue.Minimum.Single, ==, FLT_MIN);
    munit_assert_float(sValue.Value.Single, ==, -1.0f);
    value_assign(&sValue, TYPE_DINT, -1);
    munit_assert_int(value_cast(&sValue, TYPE_LINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LINT);
    munit_assert_size(sValue.Length, ==, sizeof(int64_t));
    munit_assert_int64(sValue.Maximum.S64, ==, INT64_MAX);
    munit_assert_int64(sValue.Minimum.S64, ==, INT64_MIN);
    munit_assert_int64(sValue.Value.S64, ==, -1);
    value_assign(&sValue, TYPE_DINT, -1);
    munit_assert_int(value_cast(&sValue, TYPE_DINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DINT);
    munit_assert_size(sValue.Length, ==, sizeof(int32_t));
    munit_assert_int32(sValue.Maximum.S32, ==, INT32_MAX);
    munit_assert_int32(sValue.Minimum.S32, ==, INT32_MIN);
    munit_assert_int32(sValue.Value.S32, ==, -1);
    value_assign(&sValue, TYPE_DINT, -1);
    munit_assert_int(value_cast(&sValue, TYPE_INT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_INT);
    munit_assert_size(sValue.Length, ==, sizeof(int16_t));
    munit_assert_int16(sValue.Maximum.S16, ==, INT16_MAX);
    munit_assert_int16(sValue.Minimum.S16, ==, INT16_MIN);
    munit_assert_int16(sValue.Value.S16, ==, -1);
    value_assign(&sValue, TYPE_DINT, -1);
    munit_assert_int(value_cast(&sValue, TYPE_SINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_SINT);
    munit_assert_size(sValue.Length, ==, sizeof(int8_t));
    munit_assert_int8(sValue.Maximum.S8, ==, INT8_MAX);
    munit_assert_int8(sValue.Minimum.S8, ==, INT8_MIN);
    munit_assert_int8(sValue.Value.S8, ==, -1);
    value_assign(&sValue, TYPE_DINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_ULINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_ULINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint64_t));
    munit_assert_uint64(sValue.Maximum.U64, ==, UINT64_MAX);
    munit_assert_uint64(sValue.Minimum.U64, ==, 0);
    munit_assert_uint64(sValue.Value.U64, ==, 1);
    value_assign(&sValue, TYPE_DINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_UDINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_UDINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint32_t));
    munit_assert_uint32(sValue.Maximum.U32, ==, UINT32_MAX);
    munit_assert_uint32(sValue.Minimum.U32, ==, 0);
    munit_assert_uint32(sValue.Value.U32, ==, 1);
    value_assign(&sValue, TYPE_DINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_UINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_UINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint16_t));
    munit_assert_uint16(sValue.Maximum.U16, ==, UINT16_MAX);
    munit_assert_uint16(sValue.Minimum.U16, ==, 0);
    munit_assert_uint16(sValue.Value.U16, ==, 1);
    value_assign(&sValue, TYPE_DINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_USINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_USINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.U8, ==, UINT8_MAX);
    munit_assert_uint8(sValue.Minimum.U8, ==, 0);
    munit_assert_uint8(sValue.Value.U8, ==, 1);
    value_assign(&sValue, TYPE_DINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_LWORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LWORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint64_t));
    munit_assert_uint64(sValue.Maximum.B64, ==, UINT64_MAX);
    munit_assert_uint64(sValue.Minimum.B64, ==, 0);
    munit_assert_uint64(sValue.Value.B64, ==, 1);
    value_assign(&sValue, TYPE_DINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DWORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DWORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint32_t));
    munit_assert_uint32(sValue.Maximum.B32, ==, UINT32_MAX);
    munit_assert_uint32(sValue.Minimum.B32, ==, 0);
    munit_assert_uint32(sValue.Value.B32, ==, 1);
    value_assign(&sValue, TYPE_DINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_WORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_WORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint16_t));
    munit_assert_uint16(sValue.Maximum.B16, ==, UINT16_MAX);
    munit_assert_uint16(sValue.Minimum.B16, ==, 0);
    munit_assert_uint16(sValue.Value.B16, ==, 1);
    value_assign(&sValue, TYPE_DINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_BYTE), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_BYTE);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.B8, ==, UINT8_MAX);
    munit_assert_uint8(sValue.Minimum.B8, ==, 0);
    munit_assert_uint8(sValue.Value.B8, ==, 1);
    value_assign(&sValue, TYPE_DINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_BOOL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_BOOL);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.B1, ==, 1);
    munit_assert_uint8(sValue.Minimum.B1, ==, 0);
    munit_assert_uint8(sValue.Value.B1, ==, 1);
    value_assign(&sValue, TYPE_DINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_TIME), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_TIME);
    munit_assert_size(sValue.Length, ==, sizeof(float));
    munit_assert_float(sValue.Maximum.Time, ==, FLT_MAX);
    munit_assert_float(sValue.Minimum.Time, ==, FLT_MIN);
    munit_assert_float(sValue.Value.Time, ==, 1.0);
    value_assign(&sValue, TYPE_DINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DATE), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DATE);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_assign(&sValue, TYPE_DINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DT);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_assign(&sValue, TYPE_DINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_TOD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_TOD);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_destroy(&sValue);

    //  TYPE_INT
    value_initialise(&sValue);
    value_assign(&sValue, TYPE_INT, -1);
    munit_assert_int(value_cast(&sValue, TYPE_LREAL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LREAL);
    munit_assert_size(sValue.Length, ==, sizeof(double));
    munit_assert_double(sValue.Maximum.Double, ==, DBL_MAX);
    munit_assert_double(sValue.Minimum.Double, ==, DBL_MIN);
    munit_assert_double(sValue.Value.Double, ==, -1.0);
    value_assign(&sValue, TYPE_INT, -1);
    munit_assert_int(value_cast(&sValue, TYPE_REAL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_REAL);
    munit_assert_size(sValue.Length, ==, sizeof(float));
    munit_assert_float(sValue.Maximum.Single, ==, FLT_MAX);
    munit_assert_float(sValue.Minimum.Single, ==, FLT_MIN);
    munit_assert_float(sValue.Value.Single, ==, -1.0f);
    value_assign(&sValue, TYPE_INT, -1);
    munit_assert_int(value_cast(&sValue, TYPE_LINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LINT);
    munit_assert_size(sValue.Length, ==, sizeof(int64_t));
    munit_assert_int64(sValue.Maximum.S64, ==, INT64_MAX);
    munit_assert_int64(sValue.Minimum.S64, ==, INT64_MIN);
    munit_assert_int64(sValue.Value.S64, ==, -1);
    value_assign(&sValue, TYPE_INT, -1);
    munit_assert_int(value_cast(&sValue, TYPE_DINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DINT);
    munit_assert_size(sValue.Length, ==, sizeof(int32_t));
    munit_assert_int32(sValue.Maximum.S32, ==, INT32_MAX);
    munit_assert_int32(sValue.Minimum.S32, ==, INT32_MIN);
    munit_assert_int32(sValue.Value.S32, ==, -1);
    value_assign(&sValue, TYPE_INT, -1);
    munit_assert_int(value_cast(&sValue, TYPE_INT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_INT);
    munit_assert_size(sValue.Length, ==, sizeof(int16_t));
    munit_assert_int16(sValue.Maximum.S16, ==, INT16_MAX);
    munit_assert_int16(sValue.Minimum.S16, ==, INT16_MIN);
    munit_assert_int16(sValue.Value.S16, ==, -1);
    value_assign(&sValue, TYPE_INT, -1);
    munit_assert_int(value_cast(&sValue, TYPE_SINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_SINT);
    munit_assert_size(sValue.Length, ==, sizeof(int8_t));
    munit_assert_int8(sValue.Maximum.S8, ==, INT8_MAX);
    munit_assert_int8(sValue.Minimum.S8, ==, INT8_MIN);
    munit_assert_int8(sValue.Value.S8, ==, -1);
    value_assign(&sValue, TYPE_INT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_ULINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_ULINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint64_t));
    munit_assert_uint64(sValue.Maximum.U64, ==, UINT64_MAX);
    munit_assert_uint64(sValue.Minimum.U64, ==, 0);
    munit_assert_uint64(sValue.Value.U64, ==, 1);
    value_assign(&sValue, TYPE_INT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_UDINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_UDINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint32_t));
    munit_assert_uint32(sValue.Maximum.U32, ==, UINT32_MAX);
    munit_assert_uint32(sValue.Minimum.U32, ==, 0);
    munit_assert_uint32(sValue.Value.U32, ==, 1);
    value_assign(&sValue, TYPE_INT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_UINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_UINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint16_t));
    munit_assert_uint16(sValue.Maximum.U16, ==, UINT16_MAX);
    munit_assert_uint16(sValue.Minimum.U16, ==, 0);
    munit_assert_uint16(sValue.Value.U16, ==, 1);
    value_assign(&sValue, TYPE_INT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_USINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_USINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.U8, ==, UINT8_MAX);
    munit_assert_uint8(sValue.Minimum.U8, ==, 0);
    munit_assert_uint8(sValue.Value.U8, ==, 1);
    value_assign(&sValue, TYPE_INT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_LWORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LWORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint64_t));
    munit_assert_uint64(sValue.Maximum.B64, ==, UINT64_MAX);
    munit_assert_uint64(sValue.Minimum.B64, ==, 0);
    munit_assert_uint64(sValue.Value.B64, ==, 1);
    value_assign(&sValue, TYPE_INT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DWORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DWORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint32_t));
    munit_assert_uint32(sValue.Maximum.B32, ==, UINT32_MAX);
    munit_assert_uint32(sValue.Minimum.B32, ==, 0);
    munit_assert_uint32(sValue.Value.B32, ==, 1);
    value_assign(&sValue, TYPE_INT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_WORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_WORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint16_t));
    munit_assert_uint16(sValue.Maximum.B16, ==, UINT16_MAX);
    munit_assert_uint16(sValue.Minimum.B16, ==, 0);
    munit_assert_uint16(sValue.Value.B16, ==, 1);
    value_assign(&sValue, TYPE_INT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_BYTE), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_BYTE);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.B8, ==, UINT8_MAX);
    munit_assert_uint8(sValue.Minimum.B8, ==, 0);
    munit_assert_uint8(sValue.Value.B8, ==, 1);
    value_assign(&sValue, TYPE_INT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_BOOL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_BOOL);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.B1, ==, 1);
    munit_assert_uint8(sValue.Minimum.B1, ==, 0);
    munit_assert_uint8(sValue.Value.B1, ==, 1);
    value_assign(&sValue, TYPE_INT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_TIME), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_TIME);
    munit_assert_size(sValue.Length, ==, sizeof(float));
    munit_assert_float(sValue.Maximum.Time, ==, FLT_MAX);
    munit_assert_float(sValue.Minimum.Time, ==, FLT_MIN);
    munit_assert_float(sValue.Value.Time, ==, 1.0);
    value_assign(&sValue, TYPE_INT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DATE), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DATE);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_assign(&sValue, TYPE_INT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DT);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_assign(&sValue, TYPE_INT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_TOD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_TOD);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_destroy(&sValue);

    //  TYPE_SINT
    value_initialise(&sValue);
    value_assign(&sValue, TYPE_SINT, -1);
    munit_assert_int(value_cast(&sValue, TYPE_LREAL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LREAL);
    munit_assert_size(sValue.Length, ==, sizeof(double));
    munit_assert_double(sValue.Maximum.Double, ==, DBL_MAX);
    munit_assert_double(sValue.Minimum.Double, ==, DBL_MIN);
    munit_assert_double(sValue.Value.Double, ==, -1.0);
    value_assign(&sValue, TYPE_SINT, -1);
    munit_assert_int(value_cast(&sValue, TYPE_REAL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_REAL);
    munit_assert_size(sValue.Length, ==, sizeof(float));
    munit_assert_float(sValue.Maximum.Single, ==, FLT_MAX);
    munit_assert_float(sValue.Minimum.Single, ==, FLT_MIN);
    munit_assert_float(sValue.Value.Single, ==, -1.0f);
    value_assign(&sValue, TYPE_SINT, -1);
    munit_assert_int(value_cast(&sValue, TYPE_LINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LINT);
    munit_assert_size(sValue.Length, ==, sizeof(int64_t));
    munit_assert_int64(sValue.Maximum.S64, ==, INT64_MAX);
    munit_assert_int64(sValue.Minimum.S64, ==, INT64_MIN);
    munit_assert_int64(sValue.Value.S64, ==, -1);
    value_assign(&sValue, TYPE_SINT, -1);
    munit_assert_int(value_cast(&sValue, TYPE_DINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DINT);
    munit_assert_size(sValue.Length, ==, sizeof(int32_t));
    munit_assert_int32(sValue.Maximum.S32, ==, INT32_MAX);
    munit_assert_int32(sValue.Minimum.S32, ==, INT32_MIN);
    munit_assert_int32(sValue.Value.S32, ==, -1);
    value_assign(&sValue, TYPE_SINT, -1);
    munit_assert_int(value_cast(&sValue, TYPE_INT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_INT);
    munit_assert_size(sValue.Length, ==, sizeof(int16_t));
    munit_assert_int16(sValue.Maximum.S16, ==, INT16_MAX);
    munit_assert_int16(sValue.Minimum.S16, ==, INT16_MIN);
    munit_assert_int16(sValue.Value.S16, ==, -1);
    value_assign(&sValue, TYPE_SINT, -1);
    munit_assert_int(value_cast(&sValue, TYPE_SINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_SINT);
    munit_assert_size(sValue.Length, ==, sizeof(int8_t));
    munit_assert_int8(sValue.Maximum.S8, ==, INT8_MAX);
    munit_assert_int8(sValue.Minimum.S8, ==, INT8_MIN);
    munit_assert_int8(sValue.Value.S8, ==, -1);
    value_assign(&sValue, TYPE_SINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_ULINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_ULINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint64_t));
    munit_assert_uint64(sValue.Maximum.U64, ==, UINT64_MAX);
    munit_assert_uint64(sValue.Minimum.U64, ==, 0);
    munit_assert_uint64(sValue.Value.U64, ==, 1);
    value_assign(&sValue, TYPE_SINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_UDINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_UDINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint32_t));
    munit_assert_uint32(sValue.Maximum.U32, ==, UINT32_MAX);
    munit_assert_uint32(sValue.Minimum.U32, ==, 0);
    munit_assert_uint32(sValue.Value.U32, ==, 1);
    value_assign(&sValue, TYPE_SINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_UINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_UINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint16_t));
    munit_assert_uint16(sValue.Maximum.U16, ==, UINT16_MAX);
    munit_assert_uint16(sValue.Minimum.U16, ==, 0);
    munit_assert_uint16(sValue.Value.U16, ==, 1);
    value_assign(&sValue, TYPE_SINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_USINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_USINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.U8, ==, UINT8_MAX);
    munit_assert_uint8(sValue.Minimum.U8, ==, 0);
    munit_assert_uint8(sValue.Value.U8, ==, 1);
    value_assign(&sValue, TYPE_SINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_LWORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LWORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint64_t));
    munit_assert_uint64(sValue.Maximum.B64, ==, UINT64_MAX);
    munit_assert_uint64(sValue.Minimum.B64, ==, 0);
    munit_assert_uint64(sValue.Value.B64, ==, 1);
    value_assign(&sValue, TYPE_SINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DWORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DWORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint32_t));
    munit_assert_uint32(sValue.Maximum.B32, ==, UINT32_MAX);
    munit_assert_uint32(sValue.Minimum.B32, ==, 0);
    munit_assert_uint32(sValue.Value.B32, ==, 1);
    value_assign(&sValue, TYPE_SINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_WORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_WORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint16_t));
    munit_assert_uint16(sValue.Maximum.B16, ==, UINT16_MAX);
    munit_assert_uint16(sValue.Minimum.B16, ==, 0);
    munit_assert_uint16(sValue.Value.B16, ==, 1);
    value_assign(&sValue, TYPE_SINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_BYTE), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_BYTE);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.B8, ==, UINT8_MAX);
    munit_assert_uint8(sValue.Minimum.B8, ==, 0);
    munit_assert_uint8(sValue.Value.B8, ==, 1);
    value_assign(&sValue, TYPE_SINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_BOOL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_BOOL);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.B1, ==, 1);
    munit_assert_uint8(sValue.Minimum.B1, ==, 0);
    munit_assert_uint8(sValue.Value.B1, ==, 1);
    value_assign(&sValue, TYPE_SINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_TIME), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_TIME);
    munit_assert_size(sValue.Length, ==, sizeof(float));
    munit_assert_float(sValue.Maximum.Time, ==, FLT_MAX);
    munit_assert_float(sValue.Minimum.Time, ==, FLT_MIN);
    munit_assert_float(sValue.Value.Time, ==, 1.0);
    value_assign(&sValue, TYPE_SINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DATE), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DATE);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_assign(&sValue, TYPE_SINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DT);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_assign(&sValue, TYPE_SINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_TOD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_TOD);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_destroy(&sValue);

    //  TYPE_ULINT
    value_initialise(&sValue);
    value_assign(&sValue, TYPE_ULINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_LREAL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LREAL);
    munit_assert_size(sValue.Length, ==, sizeof(double));
    munit_assert_double(sValue.Maximum.Double, ==, DBL_MAX);
    munit_assert_double(sValue.Minimum.Double, ==, DBL_MIN);
    munit_assert_double(sValue.Value.Double, ==, 1.0);
    value_assign(&sValue, TYPE_ULINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_REAL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_REAL);
    munit_assert_size(sValue.Length, ==, sizeof(float));
    munit_assert_float(sValue.Maximum.Single, ==, FLT_MAX);
    munit_assert_float(sValue.Minimum.Single, ==, FLT_MIN);
    munit_assert_float(sValue.Value.Single, ==, 1.0f);
    value_assign(&sValue, TYPE_ULINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_LINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LINT);
    munit_assert_size(sValue.Length, ==, sizeof(int64_t));
    munit_assert_int64(sValue.Maximum.S64, ==, INT64_MAX);
    munit_assert_int64(sValue.Minimum.S64, ==, INT64_MIN);
    munit_assert_int64(sValue.Value.S64, ==, 1);
    value_assign(&sValue, TYPE_ULINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DINT);
    munit_assert_size(sValue.Length, ==, sizeof(int32_t));
    munit_assert_int32(sValue.Maximum.S32, ==, INT32_MAX);
    munit_assert_int32(sValue.Minimum.S32, ==, INT32_MIN);
    munit_assert_int32(sValue.Value.S32, ==, 1);
    value_assign(&sValue, TYPE_ULINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_INT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_INT);
    munit_assert_size(sValue.Length, ==, sizeof(int16_t));
    munit_assert_int16(sValue.Maximum.S16, ==, INT16_MAX);
    munit_assert_int16(sValue.Minimum.S16, ==, INT16_MIN);
    munit_assert_int16(sValue.Value.S16, ==, 1);
    value_assign(&sValue, TYPE_ULINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_SINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_SINT);
    munit_assert_size(sValue.Length, ==, sizeof(int8_t));
    munit_assert_int8(sValue.Maximum.S8, ==, INT8_MAX);
    munit_assert_int8(sValue.Minimum.S8, ==, INT8_MIN);
    munit_assert_int8(sValue.Value.S8, ==, 1);
    value_assign(&sValue, TYPE_ULINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_ULINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_ULINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint64_t));
    munit_assert_uint64(sValue.Maximum.U64, ==, UINT64_MAX);
    munit_assert_uint64(sValue.Minimum.U64, ==, 0);
    munit_assert_uint64(sValue.Value.U64, ==, 1);
    value_assign(&sValue, TYPE_ULINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_UDINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_UDINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint32_t));
    munit_assert_uint32(sValue.Maximum.U32, ==, UINT32_MAX);
    munit_assert_uint32(sValue.Minimum.U32, ==, 0);
    munit_assert_uint32(sValue.Value.U32, ==, 1);
    value_assign(&sValue, TYPE_ULINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_UINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_UINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint16_t));
    munit_assert_uint16(sValue.Maximum.U16, ==, UINT16_MAX);
    munit_assert_uint16(sValue.Minimum.U16, ==, 0);
    munit_assert_uint16(sValue.Value.U16, ==, 1);
    value_assign(&sValue, TYPE_ULINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_USINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_USINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.U8, ==, UINT8_MAX);
    munit_assert_uint8(sValue.Minimum.U8, ==, 0);
    munit_assert_uint8(sValue.Value.U8, ==, 1);
    value_assign(&sValue, TYPE_ULINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_LWORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LWORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint64_t));
    munit_assert_uint64(sValue.Maximum.B64, ==, UINT64_MAX);
    munit_assert_uint64(sValue.Minimum.B64, ==, 0);
    munit_assert_uint64(sValue.Value.B64, ==, 1);
    value_assign(&sValue, TYPE_ULINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DWORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DWORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint32_t));
    munit_assert_uint32(sValue.Maximum.B32, ==, UINT32_MAX);
    munit_assert_uint32(sValue.Minimum.B32, ==, 0);
    munit_assert_uint32(sValue.Value.B32, ==, 1);
    value_assign(&sValue, TYPE_ULINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_WORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_WORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint16_t));
    munit_assert_uint16(sValue.Maximum.B16, ==, UINT16_MAX);
    munit_assert_uint16(sValue.Minimum.B16, ==, 0);
    munit_assert_uint16(sValue.Value.B16, ==, 1);
    value_assign(&sValue, TYPE_ULINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_BYTE), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_BYTE);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.B8, ==, UINT8_MAX);
    munit_assert_uint8(sValue.Minimum.B8, ==, 0);
    munit_assert_uint8(sValue.Value.B8, ==, 1);
    value_assign(&sValue, TYPE_ULINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_BOOL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_BOOL);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.B1, ==, 1);
    munit_assert_uint8(sValue.Minimum.B1, ==, 0);
    munit_assert_uint8(sValue.Value.B1, ==, 1);
    value_assign(&sValue, TYPE_ULINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_TIME), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_TIME);
    munit_assert_size(sValue.Length, ==, sizeof(float));
    munit_assert_float(sValue.Maximum.Time, ==, FLT_MAX);
    munit_assert_float(sValue.Minimum.Time, ==, FLT_MIN);
    munit_assert_float(sValue.Value.Time, ==, 1.0);
    value_assign(&sValue, TYPE_ULINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DATE), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DATE);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_assign(&sValue, TYPE_ULINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DT);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_assign(&sValue, TYPE_ULINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_TOD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_TOD);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_destroy(&sValue);

    //  TYPE_UDINT
    value_initialise(&sValue);
    value_assign(&sValue, TYPE_UDINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_LREAL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LREAL);
    munit_assert_size(sValue.Length, ==, sizeof(double));
    munit_assert_double(sValue.Maximum.Double, ==, DBL_MAX);
    munit_assert_double(sValue.Minimum.Double, ==, DBL_MIN);
    munit_assert_double(sValue.Value.Double, ==, 1.0);
    value_assign(&sValue, TYPE_UDINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_REAL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_REAL);
    munit_assert_size(sValue.Length, ==, sizeof(float));
    munit_assert_float(sValue.Maximum.Single, ==, FLT_MAX);
    munit_assert_float(sValue.Minimum.Single, ==, FLT_MIN);
    munit_assert_float(sValue.Value.Single, ==, 1.0f);
    value_assign(&sValue, TYPE_UDINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_LINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LINT);
    munit_assert_size(sValue.Length, ==, sizeof(int64_t));
    munit_assert_int64(sValue.Maximum.S64, ==, INT64_MAX);
    munit_assert_int64(sValue.Minimum.S64, ==, INT64_MIN);
    munit_assert_int64(sValue.Value.S64, ==, 1);
    value_assign(&sValue, TYPE_UDINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DINT);
    munit_assert_size(sValue.Length, ==, sizeof(int32_t));
    munit_assert_int32(sValue.Maximum.S32, ==, INT32_MAX);
    munit_assert_int32(sValue.Minimum.S32, ==, INT32_MIN);
    munit_assert_int32(sValue.Value.S32, ==, 1);
    value_assign(&sValue, TYPE_UDINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_INT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_INT);
    munit_assert_size(sValue.Length, ==, sizeof(int16_t));
    munit_assert_int16(sValue.Maximum.S16, ==, INT16_MAX);
    munit_assert_int16(sValue.Minimum.S16, ==, INT16_MIN);
    munit_assert_int16(sValue.Value.S16, ==, 1);
    value_assign(&sValue, TYPE_UDINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_SINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_SINT);
    munit_assert_size(sValue.Length, ==, sizeof(int8_t));
    munit_assert_int8(sValue.Maximum.S8, ==, INT8_MAX);
    munit_assert_int8(sValue.Minimum.S8, ==, INT8_MIN);
    munit_assert_int8(sValue.Value.S8, ==, 1);
    value_assign(&sValue, TYPE_UDINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_ULINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_ULINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint64_t));
    munit_assert_uint64(sValue.Maximum.U64, ==, UINT64_MAX);
    munit_assert_uint64(sValue.Minimum.U64, ==, 0);
    munit_assert_uint64(sValue.Value.U64, ==, 1);
    value_assign(&sValue, TYPE_UDINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_UDINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_UDINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint32_t));
    munit_assert_uint32(sValue.Maximum.U32, ==, UINT32_MAX);
    munit_assert_uint32(sValue.Minimum.U32, ==, 0);
    munit_assert_uint32(sValue.Value.U32, ==, 1);
    value_assign(&sValue, TYPE_UDINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_UINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_UINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint16_t));
    munit_assert_uint16(sValue.Maximum.U16, ==, UINT16_MAX);
    munit_assert_uint16(sValue.Minimum.U16, ==, 0);
    munit_assert_uint16(sValue.Value.U16, ==, 1);
    value_assign(&sValue, TYPE_UDINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_USINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_USINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.U8, ==, UINT8_MAX);
    munit_assert_uint8(sValue.Minimum.U8, ==, 0);
    munit_assert_uint8(sValue.Value.U8, ==, 1);
    value_assign(&sValue, TYPE_UDINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_LWORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LWORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint64_t));
    munit_assert_uint64(sValue.Maximum.B64, ==, UINT64_MAX);
    munit_assert_uint64(sValue.Minimum.B64, ==, 0);
    munit_assert_uint64(sValue.Value.B64, ==, 1);
    value_assign(&sValue, TYPE_UDINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DWORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DWORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint32_t));
    munit_assert_uint32(sValue.Maximum.B32, ==, UINT32_MAX);
    munit_assert_uint32(sValue.Minimum.B32, ==, 0);
    munit_assert_uint32(sValue.Value.B32, ==, 1);
    value_assign(&sValue, TYPE_UDINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_WORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_WORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint16_t));
    munit_assert_uint16(sValue.Maximum.B16, ==, UINT16_MAX);
    munit_assert_uint16(sValue.Minimum.B16, ==, 0);
    munit_assert_uint16(sValue.Value.B16, ==, 1);
    value_assign(&sValue, TYPE_UDINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_BYTE), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_BYTE);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.B8, ==, UINT8_MAX);
    munit_assert_uint8(sValue.Minimum.B8, ==, 0);
    munit_assert_uint8(sValue.Value.B8, ==, 1);
    value_assign(&sValue, TYPE_UDINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_BOOL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_BOOL);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.B1, ==, 1);
    munit_assert_uint8(sValue.Minimum.B1, ==, 0);
    munit_assert_uint8(sValue.Value.B1, ==, 1);
    value_assign(&sValue, TYPE_UDINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_TIME), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_TIME);
    munit_assert_size(sValue.Length, ==, sizeof(float));
    munit_assert_float(sValue.Maximum.Time, ==, FLT_MAX);
    munit_assert_float(sValue.Minimum.Time, ==, FLT_MIN);
    munit_assert_float(sValue.Value.Time, ==, 1.0);
    value_assign(&sValue, TYPE_UDINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DATE), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DATE);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_assign(&sValue, TYPE_UDINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DT);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_assign(&sValue, TYPE_UDINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_TOD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_TOD);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_destroy(&sValue);

    //  TYPE_UINT
    value_initialise(&sValue);
    value_assign(&sValue, TYPE_UINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_LREAL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LREAL);
    munit_assert_size(sValue.Length, ==, sizeof(double));
    munit_assert_double(sValue.Maximum.Double, ==, DBL_MAX);
    munit_assert_double(sValue.Minimum.Double, ==, DBL_MIN);
    munit_assert_double(sValue.Value.Double, ==, 1.0);
    value_assign(&sValue, TYPE_UINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_REAL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_REAL);
    munit_assert_size(sValue.Length, ==, sizeof(float));
    munit_assert_float(sValue.Maximum.Single, ==, FLT_MAX);
    munit_assert_float(sValue.Minimum.Single, ==, FLT_MIN);
    munit_assert_float(sValue.Value.Single, ==, 1.0f);
    value_assign(&sValue, TYPE_UINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_LINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LINT);
    munit_assert_size(sValue.Length, ==, sizeof(int64_t));
    munit_assert_int64(sValue.Maximum.S64, ==, INT64_MAX);
    munit_assert_int64(sValue.Minimum.S64, ==, INT64_MIN);
    munit_assert_int64(sValue.Value.S64, ==, 1);
    value_assign(&sValue, TYPE_UINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DINT);
    munit_assert_size(sValue.Length, ==, sizeof(int32_t));
    munit_assert_int32(sValue.Maximum.S32, ==, INT32_MAX);
    munit_assert_int32(sValue.Minimum.S32, ==, INT32_MIN);
    munit_assert_int32(sValue.Value.S32, ==, 1);
    value_assign(&sValue, TYPE_UINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_INT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_INT);
    munit_assert_size(sValue.Length, ==, sizeof(int16_t));
    munit_assert_int16(sValue.Maximum.S16, ==, INT16_MAX);
    munit_assert_int16(sValue.Minimum.S16, ==, INT16_MIN);
    munit_assert_int16(sValue.Value.S16, ==, 1);
    value_assign(&sValue, TYPE_UINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_SINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_SINT);
    munit_assert_size(sValue.Length, ==, sizeof(int8_t));
    munit_assert_int8(sValue.Maximum.S8, ==, INT8_MAX);
    munit_assert_int8(sValue.Minimum.S8, ==, INT8_MIN);
    munit_assert_int8(sValue.Value.S8, ==, 1);
    value_assign(&sValue, TYPE_UINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_ULINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_ULINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint64_t));
    munit_assert_uint64(sValue.Maximum.U64, ==, UINT64_MAX);
    munit_assert_uint64(sValue.Minimum.U64, ==, 0);
    munit_assert_uint64(sValue.Value.U64, ==, 1);
    value_assign(&sValue, TYPE_UINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_UDINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_UDINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint32_t));
    munit_assert_uint32(sValue.Maximum.U32, ==, UINT32_MAX);
    munit_assert_uint32(sValue.Minimum.U32, ==, 0);
    munit_assert_uint32(sValue.Value.U32, ==, 1);
    value_assign(&sValue, TYPE_UINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_UINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_UINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint16_t));
    munit_assert_uint16(sValue.Maximum.U16, ==, UINT16_MAX);
    munit_assert_uint16(sValue.Minimum.U16, ==, 0);
    munit_assert_uint16(sValue.Value.U16, ==, 1);
    value_assign(&sValue, TYPE_UINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_USINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_USINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.U8, ==, UINT8_MAX);
    munit_assert_uint8(sValue.Minimum.U8, ==, 0);
    munit_assert_uint8(sValue.Value.U8, ==, 1);
    value_assign(&sValue, TYPE_UINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_LWORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LWORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint64_t));
    munit_assert_uint64(sValue.Maximum.B64, ==, UINT64_MAX);
    munit_assert_uint64(sValue.Minimum.B64, ==, 0);
    munit_assert_uint64(sValue.Value.B64, ==, 1);
    value_assign(&sValue, TYPE_UINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DWORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DWORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint32_t));
    munit_assert_uint32(sValue.Maximum.B32, ==, UINT32_MAX);
    munit_assert_uint32(sValue.Minimum.B32, ==, 0);
    munit_assert_uint32(sValue.Value.B32, ==, 1);
    value_assign(&sValue, TYPE_UINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_WORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_WORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint16_t));
    munit_assert_uint16(sValue.Maximum.B16, ==, UINT16_MAX);
    munit_assert_uint16(sValue.Minimum.B16, ==, 0);
    munit_assert_uint16(sValue.Value.B16, ==, 1);
    value_assign(&sValue, TYPE_UINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_BYTE), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_BYTE);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.B8, ==, UINT8_MAX);
    munit_assert_uint8(sValue.Minimum.B8, ==, 0);
    munit_assert_uint8(sValue.Value.B8, ==, 1);
    value_assign(&sValue, TYPE_UINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_BOOL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_BOOL);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.B1, ==, 1);
    munit_assert_uint8(sValue.Minimum.B1, ==, 0);
    munit_assert_uint8(sValue.Value.B1, ==, 1);
    value_assign(&sValue, TYPE_UINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_TIME), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_TIME);
    munit_assert_size(sValue.Length, ==, sizeof(float));
    munit_assert_float(sValue.Maximum.Time, ==, FLT_MAX);
    munit_assert_float(sValue.Minimum.Time, ==, FLT_MIN);
    munit_assert_float(sValue.Value.Time, ==, 1.0);
    value_assign(&sValue, TYPE_UINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DATE), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DATE);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_assign(&sValue, TYPE_UINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DT);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_assign(&sValue, TYPE_UINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_TOD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_TOD);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_destroy(&sValue);

    //  TYPE_USINT
    value_initialise(&sValue);
    value_assign(&sValue, TYPE_USINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_LREAL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LREAL);
    munit_assert_size(sValue.Length, ==, sizeof(double));
    munit_assert_double(sValue.Maximum.Double, ==, DBL_MAX);
    munit_assert_double(sValue.Minimum.Double, ==, DBL_MIN);
    munit_assert_double(sValue.Value.Double, ==, 1.0);
    value_assign(&sValue, TYPE_USINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_REAL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_REAL);
    munit_assert_size(sValue.Length, ==, sizeof(float));
    munit_assert_float(sValue.Maximum.Single, ==, FLT_MAX);
    munit_assert_float(sValue.Minimum.Single, ==, FLT_MIN);
    munit_assert_float(sValue.Value.Single, ==, 1.0f);
    value_assign(&sValue, TYPE_USINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_LINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LINT);
    munit_assert_size(sValue.Length, ==, sizeof(int64_t));
    munit_assert_int64(sValue.Maximum.S64, ==, INT64_MAX);
    munit_assert_int64(sValue.Minimum.S64, ==, INT64_MIN);
    munit_assert_int64(sValue.Value.S64, ==, 1);
    value_assign(&sValue, TYPE_USINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DINT);
    munit_assert_size(sValue.Length, ==, sizeof(int32_t));
    munit_assert_int32(sValue.Maximum.S32, ==, INT32_MAX);
    munit_assert_int32(sValue.Minimum.S32, ==, INT32_MIN);
    munit_assert_int32(sValue.Value.S32, ==, 1);
    value_assign(&sValue, TYPE_USINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_INT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_INT);
    munit_assert_size(sValue.Length, ==, sizeof(int16_t));
    munit_assert_int16(sValue.Maximum.S16, ==, INT16_MAX);
    munit_assert_int16(sValue.Minimum.S16, ==, INT16_MIN);
    munit_assert_int16(sValue.Value.S16, ==, 1);
    value_assign(&sValue, TYPE_USINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_SINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_SINT);
    munit_assert_size(sValue.Length, ==, sizeof(int8_t));
    munit_assert_int8(sValue.Maximum.S8, ==, INT8_MAX);
    munit_assert_int8(sValue.Minimum.S8, ==, INT8_MIN);
    munit_assert_int8(sValue.Value.S8, ==, 1);
    value_assign(&sValue, TYPE_USINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_ULINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_ULINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint64_t));
    munit_assert_uint64(sValue.Maximum.U64, ==, UINT64_MAX);
    munit_assert_uint64(sValue.Minimum.U64, ==, 0);
    munit_assert_uint64(sValue.Value.U64, ==, 1);
    value_assign(&sValue, TYPE_USINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_UDINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_UDINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint32_t));
    munit_assert_uint32(sValue.Maximum.U32, ==, UINT32_MAX);
    munit_assert_uint32(sValue.Minimum.U32, ==, 0);
    munit_assert_uint32(sValue.Value.U32, ==, 1);
    value_assign(&sValue, TYPE_USINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_UINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_UINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint16_t));
    munit_assert_uint16(sValue.Maximum.U16, ==, UINT16_MAX);
    munit_assert_uint16(sValue.Minimum.U16, ==, 0);
    munit_assert_uint16(sValue.Value.U16, ==, 1);
    value_assign(&sValue, TYPE_USINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_USINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_USINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.U8, ==, UINT8_MAX);
    munit_assert_uint8(sValue.Minimum.U8, ==, 0);
    munit_assert_uint8(sValue.Value.U8, ==, 1);
    value_assign(&sValue, TYPE_USINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_LWORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LWORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint64_t));
    munit_assert_uint64(sValue.Maximum.B64, ==, UINT64_MAX);
    munit_assert_uint64(sValue.Minimum.B64, ==, 0);
    munit_assert_uint64(sValue.Value.B64, ==, 1);
    value_assign(&sValue, TYPE_USINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DWORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DWORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint32_t));
    munit_assert_uint32(sValue.Maximum.B32, ==, UINT32_MAX);
    munit_assert_uint32(sValue.Minimum.B32, ==, 0);
    munit_assert_uint32(sValue.Value.B32, ==, 1);
    value_assign(&sValue, TYPE_USINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_WORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_WORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint16_t));
    munit_assert_uint16(sValue.Maximum.B16, ==, UINT16_MAX);
    munit_assert_uint16(sValue.Minimum.B16, ==, 0);
    munit_assert_uint16(sValue.Value.B16, ==, 1);
    value_assign(&sValue, TYPE_USINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_BYTE), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_BYTE);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.B8, ==, UINT8_MAX);
    munit_assert_uint8(sValue.Minimum.B8, ==, 0);
    munit_assert_uint8(sValue.Value.B8, ==, 1);
    value_assign(&sValue, TYPE_USINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_BOOL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_BOOL);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.B1, ==, 1);
    munit_assert_uint8(sValue.Minimum.B1, ==, 0);
    munit_assert_uint8(sValue.Value.B1, ==, 1);
    value_assign(&sValue, TYPE_USINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_TIME), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_TIME);
    munit_assert_size(sValue.Length, ==, sizeof(float));
    munit_assert_float(sValue.Maximum.Time, ==, FLT_MAX);
    munit_assert_float(sValue.Minimum.Time, ==, FLT_MIN);
    munit_assert_float(sValue.Value.Time, ==, 1.0);
    value_assign(&sValue, TYPE_USINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DATE), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DATE);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_assign(&sValue, TYPE_USINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DT);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_assign(&sValue, TYPE_USINT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_TOD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_TOD);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_destroy(&sValue);

    //  TYPE_LWORD
    value_initialise(&sValue);
    value_assign(&sValue, TYPE_LWORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_LREAL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LREAL);
    munit_assert_size(sValue.Length, ==, sizeof(double));
    munit_assert_double(sValue.Maximum.Double, ==, DBL_MAX);
    munit_assert_double(sValue.Minimum.Double, ==, DBL_MIN);
    munit_assert_double(sValue.Value.Double, ==, 1.0);
    value_assign(&sValue, TYPE_LWORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_REAL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_REAL);
    munit_assert_size(sValue.Length, ==, sizeof(float));
    munit_assert_float(sValue.Maximum.Single, ==, FLT_MAX);
    munit_assert_float(sValue.Minimum.Single, ==, FLT_MIN);
    munit_assert_float(sValue.Value.Single, ==, 1.0f);
    value_assign(&sValue, TYPE_LWORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_LINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LINT);
    munit_assert_size(sValue.Length, ==, sizeof(int64_t));
    munit_assert_int64(sValue.Maximum.S64, ==, INT64_MAX);
    munit_assert_int64(sValue.Minimum.S64, ==, INT64_MIN);
    munit_assert_int64(sValue.Value.S64, ==, 1);
    value_assign(&sValue, TYPE_LWORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DINT);
    munit_assert_size(sValue.Length, ==, sizeof(int32_t));
    munit_assert_int32(sValue.Maximum.S32, ==, INT32_MAX);
    munit_assert_int32(sValue.Minimum.S32, ==, INT32_MIN);
    munit_assert_int32(sValue.Value.S32, ==, 1);
    value_assign(&sValue, TYPE_LWORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_INT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_INT);
    munit_assert_size(sValue.Length, ==, sizeof(int16_t));
    munit_assert_int16(sValue.Maximum.S16, ==, INT16_MAX);
    munit_assert_int16(sValue.Minimum.S16, ==, INT16_MIN);
    munit_assert_int16(sValue.Value.S16, ==, 1);
    value_assign(&sValue, TYPE_LWORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_SINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_SINT);
    munit_assert_size(sValue.Length, ==, sizeof(int8_t));
    munit_assert_int8(sValue.Maximum.S8, ==, INT8_MAX);
    munit_assert_int8(sValue.Minimum.S8, ==, INT8_MIN);
    munit_assert_int8(sValue.Value.S8, ==, 1);
    value_assign(&sValue, TYPE_LWORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_ULINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_ULINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint64_t));
    munit_assert_uint64(sValue.Maximum.U64, ==, UINT64_MAX);
    munit_assert_uint64(sValue.Minimum.U64, ==, 0);
    munit_assert_uint64(sValue.Value.U64, ==, 1);
    value_assign(&sValue, TYPE_LWORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_UDINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_UDINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint32_t));
    munit_assert_uint32(sValue.Maximum.U32, ==, UINT32_MAX);
    munit_assert_uint32(sValue.Minimum.U32, ==, 0);
    munit_assert_uint32(sValue.Value.U32, ==, 1);
    value_assign(&sValue, TYPE_LWORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_UINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_UINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint16_t));
    munit_assert_uint16(sValue.Maximum.U16, ==, UINT16_MAX);
    munit_assert_uint16(sValue.Minimum.U16, ==, 0);
    munit_assert_uint16(sValue.Value.U16, ==, 1);
    value_assign(&sValue, TYPE_LWORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_USINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_USINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.U8, ==, UINT8_MAX);
    munit_assert_uint8(sValue.Minimum.U8, ==, 0);
    munit_assert_uint8(sValue.Value.U8, ==, 1);
    value_assign(&sValue, TYPE_LWORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_LWORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LWORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint64_t));
    munit_assert_uint64(sValue.Maximum.B64, ==, UINT64_MAX);
    munit_assert_uint64(sValue.Minimum.B64, ==, 0);
    munit_assert_uint64(sValue.Value.B64, ==, 1);
    value_assign(&sValue, TYPE_LWORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DWORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DWORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint32_t));
    munit_assert_uint32(sValue.Maximum.B32, ==, UINT32_MAX);
    munit_assert_uint32(sValue.Minimum.B32, ==, 0);
    munit_assert_uint32(sValue.Value.B32, ==, 1);
    value_assign(&sValue, TYPE_LWORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_WORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_WORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint16_t));
    munit_assert_uint16(sValue.Maximum.B16, ==, UINT16_MAX);
    munit_assert_uint16(sValue.Minimum.B16, ==, 0);
    munit_assert_uint16(sValue.Value.B16, ==, 1);
    value_assign(&sValue, TYPE_LWORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_BYTE), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_BYTE);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.B8, ==, UINT8_MAX);
    munit_assert_uint8(sValue.Minimum.B8, ==, 0);
    munit_assert_uint8(sValue.Value.B8, ==, 1);
    value_assign(&sValue, TYPE_LWORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_BOOL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_BOOL);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.B1, ==, 1);
    munit_assert_uint8(sValue.Minimum.B1, ==, 0);
    munit_assert_uint8(sValue.Value.B1, ==, 1);
    value_assign(&sValue, TYPE_LWORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_TIME), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_TIME);
    munit_assert_size(sValue.Length, ==, sizeof(float));
    munit_assert_float(sValue.Maximum.Time, ==, FLT_MAX);
    munit_assert_float(sValue.Minimum.Time, ==, FLT_MIN);
    munit_assert_float(sValue.Value.Time, ==, 1.0);
    value_assign(&sValue, TYPE_LWORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DATE), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DATE);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_assign(&sValue, TYPE_LWORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DT);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_assign(&sValue, TYPE_LWORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_TOD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_TOD);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_destroy(&sValue);

    //  TYPE_DWORD
    value_initialise(&sValue);
    value_assign(&sValue, TYPE_DWORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_LREAL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LREAL);
    munit_assert_size(sValue.Length, ==, sizeof(double));
    munit_assert_double(sValue.Maximum.Double, ==, DBL_MAX);
    munit_assert_double(sValue.Minimum.Double, ==, DBL_MIN);
    munit_assert_double(sValue.Value.Double, ==, 1.0);
    value_assign(&sValue, TYPE_DWORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_REAL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_REAL);
    munit_assert_size(sValue.Length, ==, sizeof(float));
    munit_assert_float(sValue.Maximum.Single, ==, FLT_MAX);
    munit_assert_float(sValue.Minimum.Single, ==, FLT_MIN);
    munit_assert_float(sValue.Value.Single, ==, 1.0f);
    value_assign(&sValue, TYPE_DWORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_LINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LINT);
    munit_assert_size(sValue.Length, ==, sizeof(int64_t));
    munit_assert_int64(sValue.Maximum.S64, ==, INT64_MAX);
    munit_assert_int64(sValue.Minimum.S64, ==, INT64_MIN);
    munit_assert_int64(sValue.Value.S64, ==, 1);
    value_assign(&sValue, TYPE_DWORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DINT);
    munit_assert_size(sValue.Length, ==, sizeof(int32_t));
    munit_assert_int32(sValue.Maximum.S32, ==, INT32_MAX);
    munit_assert_int32(sValue.Minimum.S32, ==, INT32_MIN);
    munit_assert_int32(sValue.Value.S32, ==, 1);
    value_assign(&sValue, TYPE_DWORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_INT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_INT);
    munit_assert_size(sValue.Length, ==, sizeof(int16_t));
    munit_assert_int16(sValue.Maximum.S16, ==, INT16_MAX);
    munit_assert_int16(sValue.Minimum.S16, ==, INT16_MIN);
    munit_assert_int16(sValue.Value.S16, ==, 1);
    value_assign(&sValue, TYPE_DWORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_SINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_SINT);
    munit_assert_size(sValue.Length, ==, sizeof(int8_t));
    munit_assert_int8(sValue.Maximum.S8, ==, INT8_MAX);
    munit_assert_int8(sValue.Minimum.S8, ==, INT8_MIN);
    munit_assert_int8(sValue.Value.S8, ==, 1);
    value_assign(&sValue, TYPE_DWORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_ULINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_ULINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint64_t));
    munit_assert_uint64(sValue.Maximum.U64, ==, UINT64_MAX);
    munit_assert_uint64(sValue.Minimum.U64, ==, 0);
    munit_assert_uint64(sValue.Value.U64, ==, 1);
    value_assign(&sValue, TYPE_DWORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_UDINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_UDINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint32_t));
    munit_assert_uint32(sValue.Maximum.U32, ==, UINT32_MAX);
    munit_assert_uint32(sValue.Minimum.U32, ==, 0);
    munit_assert_uint32(sValue.Value.U32, ==, 1);
    value_assign(&sValue, TYPE_DWORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_UINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_UINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint16_t));
    munit_assert_uint16(sValue.Maximum.U16, ==, UINT16_MAX);
    munit_assert_uint16(sValue.Minimum.U16, ==, 0);
    munit_assert_uint16(sValue.Value.U16, ==, 1);
    value_assign(&sValue, TYPE_DWORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_USINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_USINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.U8, ==, UINT8_MAX);
    munit_assert_uint8(sValue.Minimum.U8, ==, 0);
    munit_assert_uint8(sValue.Value.U8, ==, 1);
    value_assign(&sValue, TYPE_DWORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_LWORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LWORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint64_t));
    munit_assert_uint64(sValue.Maximum.B64, ==, UINT64_MAX);
    munit_assert_uint64(sValue.Minimum.B64, ==, 0);
    munit_assert_uint64(sValue.Value.B64, ==, 1);
    value_assign(&sValue, TYPE_DWORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DWORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DWORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint32_t));
    munit_assert_uint32(sValue.Maximum.B32, ==, UINT32_MAX);
    munit_assert_uint32(sValue.Minimum.B32, ==, 0);
    munit_assert_uint32(sValue.Value.B32, ==, 1);
    value_assign(&sValue, TYPE_DWORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_WORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_WORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint16_t));
    munit_assert_uint16(sValue.Maximum.B16, ==, UINT16_MAX);
    munit_assert_uint16(sValue.Minimum.B16, ==, 0);
    munit_assert_uint16(sValue.Value.B16, ==, 1);
    value_assign(&sValue, TYPE_DWORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_BYTE), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_BYTE);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.B8, ==, UINT8_MAX);
    munit_assert_uint8(sValue.Minimum.B8, ==, 0);
    munit_assert_uint8(sValue.Value.B8, ==, 1);
    value_assign(&sValue, TYPE_DWORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_BOOL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_BOOL);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.B1, ==, 1);
    munit_assert_uint8(sValue.Minimum.B1, ==, 0);
    munit_assert_uint8(sValue.Value.B1, ==, 1);
    value_assign(&sValue, TYPE_DWORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_TIME), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_TIME);
    munit_assert_size(sValue.Length, ==, sizeof(float));
    munit_assert_float(sValue.Maximum.Time, ==, FLT_MAX);
    munit_assert_float(sValue.Minimum.Time, ==, FLT_MIN);
    munit_assert_float(sValue.Value.Time, ==, 1.0);
    value_assign(&sValue, TYPE_DWORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DATE), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DATE);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_assign(&sValue, TYPE_DWORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DT);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_assign(&sValue, TYPE_DWORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_TOD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_TOD);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_destroy(&sValue);

    //  TYPE_WORD
    value_initialise(&sValue);
    value_assign(&sValue, TYPE_WORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_LREAL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LREAL);
    munit_assert_size(sValue.Length, ==, sizeof(double));
    munit_assert_double(sValue.Maximum.Double, ==, DBL_MAX);
    munit_assert_double(sValue.Minimum.Double, ==, DBL_MIN);
    munit_assert_double(sValue.Value.Double, ==, 1.0);
    value_assign(&sValue, TYPE_WORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_REAL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_REAL);
    munit_assert_size(sValue.Length, ==, sizeof(float));
    munit_assert_float(sValue.Maximum.Single, ==, FLT_MAX);
    munit_assert_float(sValue.Minimum.Single, ==, FLT_MIN);
    munit_assert_float(sValue.Value.Single, ==, 1.0f);
    value_assign(&sValue, TYPE_WORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_LINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LINT);
    munit_assert_size(sValue.Length, ==, sizeof(int64_t));
    munit_assert_int64(sValue.Maximum.S64, ==, INT64_MAX);
    munit_assert_int64(sValue.Minimum.S64, ==, INT64_MIN);
    munit_assert_int64(sValue.Value.S64, ==, 1);
    value_assign(&sValue, TYPE_WORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DINT);
    munit_assert_size(sValue.Length, ==, sizeof(int32_t));
    munit_assert_int32(sValue.Maximum.S32, ==, INT32_MAX);
    munit_assert_int32(sValue.Minimum.S32, ==, INT32_MIN);
    munit_assert_int32(sValue.Value.S32, ==, 1);
    value_assign(&sValue, TYPE_WORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_INT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_INT);
    munit_assert_size(sValue.Length, ==, sizeof(int16_t));
    munit_assert_int16(sValue.Maximum.S16, ==, INT16_MAX);
    munit_assert_int16(sValue.Minimum.S16, ==, INT16_MIN);
    munit_assert_int16(sValue.Value.S16, ==, 1);
    value_assign(&sValue, TYPE_WORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_SINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_SINT);
    munit_assert_size(sValue.Length, ==, sizeof(int8_t));
    munit_assert_int8(sValue.Maximum.S8, ==, INT8_MAX);
    munit_assert_int8(sValue.Minimum.S8, ==, INT8_MIN);
    munit_assert_int8(sValue.Value.S8, ==, 1);
    value_assign(&sValue, TYPE_WORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_ULINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_ULINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint64_t));
    munit_assert_uint64(sValue.Maximum.U64, ==, UINT64_MAX);
    munit_assert_uint64(sValue.Minimum.U64, ==, 0);
    munit_assert_uint64(sValue.Value.U64, ==, 1);
    value_assign(&sValue, TYPE_WORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_UDINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_UDINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint32_t));
    munit_assert_uint32(sValue.Maximum.U32, ==, UINT32_MAX);
    munit_assert_uint32(sValue.Minimum.U32, ==, 0);
    munit_assert_uint32(sValue.Value.U32, ==, 1);
    value_assign(&sValue, TYPE_WORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_UINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_UINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint16_t));
    munit_assert_uint16(sValue.Maximum.U16, ==, UINT16_MAX);
    munit_assert_uint16(sValue.Minimum.U16, ==, 0);
    munit_assert_uint16(sValue.Value.U16, ==, 1);
    value_assign(&sValue, TYPE_WORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_USINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_USINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.U8, ==, UINT8_MAX);
    munit_assert_uint8(sValue.Minimum.U8, ==, 0);
    munit_assert_uint8(sValue.Value.U8, ==, 1);
    value_assign(&sValue, TYPE_WORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_LWORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LWORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint64_t));
    munit_assert_uint64(sValue.Maximum.B64, ==, UINT64_MAX);
    munit_assert_uint64(sValue.Minimum.B64, ==, 0);
    munit_assert_uint64(sValue.Value.B64, ==, 1);
    value_assign(&sValue, TYPE_WORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DWORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DWORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint32_t));
    munit_assert_uint32(sValue.Maximum.B32, ==, UINT32_MAX);
    munit_assert_uint32(sValue.Minimum.B32, ==, 0);
    munit_assert_uint32(sValue.Value.B32, ==, 1);
    value_assign(&sValue, TYPE_WORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_WORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_WORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint16_t));
    munit_assert_uint16(sValue.Maximum.B16, ==, UINT16_MAX);
    munit_assert_uint16(sValue.Minimum.B16, ==, 0);
    munit_assert_uint16(sValue.Value.B16, ==, 1);
    value_assign(&sValue, TYPE_WORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_BYTE), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_BYTE);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.B8, ==, UINT8_MAX);
    munit_assert_uint8(sValue.Minimum.B8, ==, 0);
    munit_assert_uint8(sValue.Value.B8, ==, 1);
    value_assign(&sValue, TYPE_WORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_BOOL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_BOOL);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.B1, ==, 1);
    munit_assert_uint8(sValue.Minimum.B1, ==, 0);
    munit_assert_uint8(sValue.Value.B1, ==, 1);
    value_assign(&sValue, TYPE_WORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_TIME), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_TIME);
    munit_assert_size(sValue.Length, ==, sizeof(float));
    munit_assert_float(sValue.Maximum.Time, ==, FLT_MAX);
    munit_assert_float(sValue.Minimum.Time, ==, FLT_MIN);
    munit_assert_float(sValue.Value.Time, ==, 1.0);
    value_assign(&sValue, TYPE_WORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DATE), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DATE);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_assign(&sValue, TYPE_WORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DT);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_assign(&sValue, TYPE_WORD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_TOD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_TOD);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_destroy(&sValue);

    //  TYPE_BYTE
    value_initialise(&sValue);
    value_assign(&sValue, TYPE_BYTE, 1);
    munit_assert_int(value_cast(&sValue, TYPE_LREAL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LREAL);
    munit_assert_size(sValue.Length, ==, sizeof(double));
    munit_assert_double(sValue.Maximum.Double, ==, DBL_MAX);
    munit_assert_double(sValue.Minimum.Double, ==, DBL_MIN);
    munit_assert_double(sValue.Value.Double, ==, 1.0);
    value_assign(&sValue, TYPE_BYTE, 1);
    munit_assert_int(value_cast(&sValue, TYPE_REAL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_REAL);
    munit_assert_size(sValue.Length, ==, sizeof(float));
    munit_assert_float(sValue.Maximum.Single, ==, FLT_MAX);
    munit_assert_float(sValue.Minimum.Single, ==, FLT_MIN);
    munit_assert_float(sValue.Value.Single, ==, 1.0f);
    value_assign(&sValue, TYPE_BYTE, 1);
    munit_assert_int(value_cast(&sValue, TYPE_LINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LINT);
    munit_assert_size(sValue.Length, ==, sizeof(int64_t));
    munit_assert_int64(sValue.Maximum.S64, ==, INT64_MAX);
    munit_assert_int64(sValue.Minimum.S64, ==, INT64_MIN);
    munit_assert_int64(sValue.Value.S64, ==, 1);
    value_assign(&sValue, TYPE_BYTE, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DINT);
    munit_assert_size(sValue.Length, ==, sizeof(int32_t));
    munit_assert_int32(sValue.Maximum.S32, ==, INT32_MAX);
    munit_assert_int32(sValue.Minimum.S32, ==, INT32_MIN);
    munit_assert_int32(sValue.Value.S32, ==, 1);
    value_assign(&sValue, TYPE_BYTE, 1);
    munit_assert_int(value_cast(&sValue, TYPE_INT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_INT);
    munit_assert_size(sValue.Length, ==, sizeof(int16_t));
    munit_assert_int16(sValue.Maximum.S16, ==, INT16_MAX);
    munit_assert_int16(sValue.Minimum.S16, ==, INT16_MIN);
    munit_assert_int16(sValue.Value.S16, ==, 1);
    value_assign(&sValue, TYPE_BYTE, 1);
    munit_assert_int(value_cast(&sValue, TYPE_SINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_SINT);
    munit_assert_size(sValue.Length, ==, sizeof(int8_t));
    munit_assert_int8(sValue.Maximum.S8, ==, INT8_MAX);
    munit_assert_int8(sValue.Minimum.S8, ==, INT8_MIN);
    munit_assert_int8(sValue.Value.S8, ==, 1);
    value_assign(&sValue, TYPE_BYTE, 1);
    munit_assert_int(value_cast(&sValue, TYPE_ULINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_ULINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint64_t));
    munit_assert_uint64(sValue.Maximum.U64, ==, UINT64_MAX);
    munit_assert_uint64(sValue.Minimum.U64, ==, 0);
    munit_assert_uint64(sValue.Value.U64, ==, 1);
    value_assign(&sValue, TYPE_BYTE, 1);
    munit_assert_int(value_cast(&sValue, TYPE_UDINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_UDINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint32_t));
    munit_assert_uint32(sValue.Maximum.U32, ==, UINT32_MAX);
    munit_assert_uint32(sValue.Minimum.U32, ==, 0);
    munit_assert_uint32(sValue.Value.U32, ==, 1);
    value_assign(&sValue, TYPE_BYTE, 1);
    munit_assert_int(value_cast(&sValue, TYPE_UINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_UINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint16_t));
    munit_assert_uint16(sValue.Maximum.U16, ==, UINT16_MAX);
    munit_assert_uint16(sValue.Minimum.U16, ==, 0);
    munit_assert_uint16(sValue.Value.U16, ==, 1);
    value_assign(&sValue, TYPE_BYTE, 1);
    munit_assert_int(value_cast(&sValue, TYPE_USINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_USINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.U8, ==, UINT8_MAX);
    munit_assert_uint8(sValue.Minimum.U8, ==, 0);
    munit_assert_uint8(sValue.Value.U8, ==, 1);
    value_assign(&sValue, TYPE_BYTE, 1);
    munit_assert_int(value_cast(&sValue, TYPE_LWORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LWORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint64_t));
    munit_assert_uint64(sValue.Maximum.B64, ==, UINT64_MAX);
    munit_assert_uint64(sValue.Minimum.B64, ==, 0);
    munit_assert_uint64(sValue.Value.B64, ==, 1);
    value_assign(&sValue, TYPE_BYTE, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DWORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DWORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint32_t));
    munit_assert_uint32(sValue.Maximum.B32, ==, UINT32_MAX);
    munit_assert_uint32(sValue.Minimum.B32, ==, 0);
    munit_assert_uint32(sValue.Value.B32, ==, 1);
    value_assign(&sValue, TYPE_BYTE, 1);
    munit_assert_int(value_cast(&sValue, TYPE_WORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_WORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint16_t));
    munit_assert_uint16(sValue.Maximum.B16, ==, UINT16_MAX);
    munit_assert_uint16(sValue.Minimum.B16, ==, 0);
    munit_assert_uint16(sValue.Value.B16, ==, 1);
    value_assign(&sValue, TYPE_BYTE, 1);
    munit_assert_int(value_cast(&sValue, TYPE_BYTE), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_BYTE);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.B8, ==, UINT8_MAX);
    munit_assert_uint8(sValue.Minimum.B8, ==, 0);
    munit_assert_uint8(sValue.Value.B8, ==, 1);
    value_assign(&sValue, TYPE_BYTE, 1);
    munit_assert_int(value_cast(&sValue, TYPE_BOOL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_BOOL);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.B1, ==, 1);
    munit_assert_uint8(sValue.Minimum.B1, ==, 0);
    munit_assert_uint8(sValue.Value.B1, ==, 1);
    value_assign(&sValue, TYPE_BYTE, 1);
    munit_assert_int(value_cast(&sValue, TYPE_TIME), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_TIME);
    munit_assert_size(sValue.Length, ==, sizeof(float));
    munit_assert_float(sValue.Maximum.Time, ==, FLT_MAX);
    munit_assert_float(sValue.Minimum.Time, ==, FLT_MIN);
    munit_assert_float(sValue.Value.Time, ==, 1.0);
    value_assign(&sValue, TYPE_BYTE, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DATE), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DATE);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_assign(&sValue, TYPE_BYTE, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DT);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_assign(&sValue, TYPE_BYTE, 1);
    munit_assert_int(value_cast(&sValue, TYPE_TOD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_TOD);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_destroy(&sValue);

    //  TYPE_BOOL
    value_initialise(&sValue);
    value_assign(&sValue, TYPE_BOOL, 1);
    munit_assert_int(value_cast(&sValue, TYPE_LREAL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LREAL);
    munit_assert_size(sValue.Length, ==, sizeof(double));
    munit_assert_double(sValue.Maximum.Double, ==, DBL_MAX);
    munit_assert_double(sValue.Minimum.Double, ==, DBL_MIN);
    munit_assert_double(sValue.Value.Double, ==, 1.0);
    value_assign(&sValue, TYPE_BOOL, 1);
    munit_assert_int(value_cast(&sValue, TYPE_REAL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_REAL);
    munit_assert_size(sValue.Length, ==, sizeof(float));
    munit_assert_float(sValue.Maximum.Single, ==, FLT_MAX);
    munit_assert_float(sValue.Minimum.Single, ==, FLT_MIN);
    munit_assert_float(sValue.Value.Single, ==, 1.0f);
    value_assign(&sValue, TYPE_BOOL, 1);
    munit_assert_int(value_cast(&sValue, TYPE_LINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LINT);
    munit_assert_size(sValue.Length, ==, sizeof(int64_t));
    munit_assert_int64(sValue.Maximum.S64, ==, INT64_MAX);
    munit_assert_int64(sValue.Minimum.S64, ==, INT64_MIN);
    munit_assert_int64(sValue.Value.S64, ==, 1);
    value_assign(&sValue, TYPE_BOOL, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DINT);
    munit_assert_size(sValue.Length, ==, sizeof(int32_t));
    munit_assert_int32(sValue.Maximum.S32, ==, INT32_MAX);
    munit_assert_int32(sValue.Minimum.S32, ==, INT32_MIN);
    munit_assert_int32(sValue.Value.S32, ==, 1);
    value_assign(&sValue, TYPE_BOOL, 1);
    munit_assert_int(value_cast(&sValue, TYPE_INT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_INT);
    munit_assert_size(sValue.Length, ==, sizeof(int16_t));
    munit_assert_int16(sValue.Maximum.S16, ==, INT16_MAX);
    munit_assert_int16(sValue.Minimum.S16, ==, INT16_MIN);
    munit_assert_int16(sValue.Value.S16, ==, 1);
    value_assign(&sValue, TYPE_BOOL, 1);
    munit_assert_int(value_cast(&sValue, TYPE_SINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_SINT);
    munit_assert_size(sValue.Length, ==, sizeof(int8_t));
    munit_assert_int8(sValue.Maximum.S8, ==, INT8_MAX);
    munit_assert_int8(sValue.Minimum.S8, ==, INT8_MIN);
    munit_assert_int8(sValue.Value.S8, ==, 1);
    value_assign(&sValue, TYPE_BOOL, 1);
    munit_assert_int(value_cast(&sValue, TYPE_ULINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_ULINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint64_t));
    munit_assert_uint64(sValue.Maximum.U64, ==, UINT64_MAX);
    munit_assert_uint64(sValue.Minimum.U64, ==, 0);
    munit_assert_uint64(sValue.Value.U64, ==, 1);
    value_assign(&sValue, TYPE_BOOL, 1);
    munit_assert_int(value_cast(&sValue, TYPE_UDINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_UDINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint32_t));
    munit_assert_uint32(sValue.Maximum.U32, ==, UINT32_MAX);
    munit_assert_uint32(sValue.Minimum.U32, ==, 0);
    munit_assert_uint32(sValue.Value.U32, ==, 1);
    value_assign(&sValue, TYPE_BOOL, 1);
    munit_assert_int(value_cast(&sValue, TYPE_UINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_UINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint16_t));
    munit_assert_uint16(sValue.Maximum.U16, ==, UINT16_MAX);
    munit_assert_uint16(sValue.Minimum.U16, ==, 0);
    munit_assert_uint16(sValue.Value.U16, ==, 1);
    value_assign(&sValue, TYPE_BOOL, 1);
    munit_assert_int(value_cast(&sValue, TYPE_USINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_USINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.U8, ==, UINT8_MAX);
    munit_assert_uint8(sValue.Minimum.U8, ==, 0);
    munit_assert_uint8(sValue.Value.U8, ==, 1);
    value_assign(&sValue, TYPE_BOOL, 1);
    munit_assert_int(value_cast(&sValue, TYPE_LWORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LWORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint64_t));
    munit_assert_uint64(sValue.Maximum.B64, ==, UINT64_MAX);
    munit_assert_uint64(sValue.Minimum.B64, ==, 0);
    munit_assert_uint64(sValue.Value.B64, ==, 1);
    value_assign(&sValue, TYPE_BOOL, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DWORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DWORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint32_t));
    munit_assert_uint32(sValue.Maximum.B32, ==, UINT32_MAX);
    munit_assert_uint32(sValue.Minimum.B32, ==, 0);
    munit_assert_uint32(sValue.Value.B32, ==, 1);
    value_assign(&sValue, TYPE_BOOL, 1);
    munit_assert_int(value_cast(&sValue, TYPE_WORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_WORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint16_t));
    munit_assert_uint16(sValue.Maximum.B16, ==, UINT16_MAX);
    munit_assert_uint16(sValue.Minimum.B16, ==, 0);
    munit_assert_uint16(sValue.Value.B16, ==, 1);
    value_assign(&sValue, TYPE_BOOL, 1);
    munit_assert_int(value_cast(&sValue, TYPE_BYTE), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_BYTE);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.B8, ==, UINT8_MAX);
    munit_assert_uint8(sValue.Minimum.B8, ==, 0);
    munit_assert_uint8(sValue.Value.B8, ==, 1);
    value_assign(&sValue, TYPE_BOOL, 1);
    munit_assert_int(value_cast(&sValue, TYPE_BOOL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_BOOL);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.B1, ==, 1);
    munit_assert_uint8(sValue.Minimum.B1, ==, 0);
    munit_assert_uint8(sValue.Value.B1, ==, 1);
    value_assign(&sValue, TYPE_BOOL, 1);
    munit_assert_int(value_cast(&sValue, TYPE_TIME), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_TIME);
    munit_assert_size(sValue.Length, ==, sizeof(float));
    munit_assert_float(sValue.Maximum.Time, ==, FLT_MAX);
    munit_assert_float(sValue.Minimum.Time, ==, FLT_MIN);
    munit_assert_float(sValue.Value.Time, ==, 1.0);
    value_assign(&sValue, TYPE_BOOL, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DATE), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DATE);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_assign(&sValue, TYPE_BOOL, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DT);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_assign(&sValue, TYPE_BOOL, 1);
    munit_assert_int(value_cast(&sValue, TYPE_TOD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_TOD);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_destroy(&sValue);

    //  TYPE_TIME
    value_initialise(&sValue);
    value_assign(&sValue, TYPE_TIME, 1.0);
    munit_assert_int(value_cast(&sValue, TYPE_LREAL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LREAL);
    munit_assert_size(sValue.Length, ==, sizeof(double));
    munit_assert_double(sValue.Maximum.Double, ==, DBL_MAX);
    munit_assert_double(sValue.Minimum.Double, ==, DBL_MIN);
    munit_assert_double(sValue.Value.Double, ==, 1.0);
    value_assign(&sValue, TYPE_TIME, 1.0);
    munit_assert_int(value_cast(&sValue, TYPE_REAL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_REAL);
    munit_assert_size(sValue.Length, ==, sizeof(float));
    munit_assert_float(sValue.Maximum.Single, ==, FLT_MAX);
    munit_assert_float(sValue.Minimum.Single, ==, FLT_MIN);
    munit_assert_float(sValue.Value.Single, ==, 1.0f);
    value_assign(&sValue, TYPE_TIME, 1.0);
    munit_assert_int(value_cast(&sValue, TYPE_LINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LINT);
    munit_assert_size(sValue.Length, ==, sizeof(int64_t));
    munit_assert_int64(sValue.Maximum.S64, ==, INT64_MAX);
    munit_assert_int64(sValue.Minimum.S64, ==, INT64_MIN);
    munit_assert_int64(sValue.Value.S64, ==, 1);
    value_assign(&sValue, TYPE_TIME, 1.0);
    munit_assert_int(value_cast(&sValue, TYPE_DINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DINT);
    munit_assert_size(sValue.Length, ==, sizeof(int32_t));
    munit_assert_int32(sValue.Maximum.S32, ==, INT32_MAX);
    munit_assert_int32(sValue.Minimum.S32, ==, INT32_MIN);
    munit_assert_int32(sValue.Value.S32, ==, 1);
    value_assign(&sValue, TYPE_TIME, 1.0);
    munit_assert_int(value_cast(&sValue, TYPE_INT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_INT);
    munit_assert_size(sValue.Length, ==, sizeof(int16_t));
    munit_assert_int16(sValue.Maximum.S16, ==, INT16_MAX);
    munit_assert_int16(sValue.Minimum.S16, ==, INT16_MIN);
    munit_assert_int16(sValue.Value.S16, ==, 1);
    value_assign(&sValue, TYPE_TIME, 1.0);
    munit_assert_int(value_cast(&sValue, TYPE_SINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_SINT);
    munit_assert_size(sValue.Length, ==, sizeof(int8_t));
    munit_assert_int8(sValue.Maximum.S8, ==, INT8_MAX);
    munit_assert_int8(sValue.Minimum.S8, ==, INT8_MIN);
    munit_assert_int8(sValue.Value.S8, ==, 1);
    value_assign(&sValue, TYPE_TIME, 1.0);
    munit_assert_int(value_cast(&sValue, TYPE_ULINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_ULINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint64_t));
    munit_assert_uint64(sValue.Maximum.U64, ==, UINT64_MAX);
    munit_assert_uint64(sValue.Minimum.U64, ==, 0);
    munit_assert_uint64(sValue.Value.U64, ==, 1);
    value_assign(&sValue, TYPE_TIME, 1.0);
    munit_assert_int(value_cast(&sValue, TYPE_UDINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_UDINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint32_t));
    munit_assert_uint32(sValue.Maximum.U32, ==, UINT32_MAX);
    munit_assert_uint32(sValue.Minimum.U32, ==, 0);
    munit_assert_uint32(sValue.Value.U32, ==, 1);
    value_assign(&sValue, TYPE_TIME, 1.0);
    munit_assert_int(value_cast(&sValue, TYPE_UINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_UINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint16_t));
    munit_assert_uint16(sValue.Maximum.U16, ==, UINT16_MAX);
    munit_assert_uint16(sValue.Minimum.U16, ==, 0);
    munit_assert_uint16(sValue.Value.U16, ==, 1);
    value_assign(&sValue, TYPE_TIME, 1.0);
    munit_assert_int(value_cast(&sValue, TYPE_USINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_USINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.U8, ==, UINT8_MAX);
    munit_assert_uint8(sValue.Minimum.U8, ==, 0);
    munit_assert_uint8(sValue.Value.U8, ==, 1);
    value_assign(&sValue, TYPE_TIME, 1.0);
    munit_assert_int(value_cast(&sValue, TYPE_LWORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LWORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint64_t));
    munit_assert_uint64(sValue.Maximum.B64, ==, UINT64_MAX);
    munit_assert_uint64(sValue.Minimum.B64, ==, 0);
    munit_assert_uint64(sValue.Value.B64, ==, 1);
    value_assign(&sValue, TYPE_TIME, 1.0);
    munit_assert_int(value_cast(&sValue, TYPE_DWORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DWORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint32_t));
    munit_assert_uint32(sValue.Maximum.B32, ==, UINT32_MAX);
    munit_assert_uint32(sValue.Minimum.B32, ==, 0);
    munit_assert_uint32(sValue.Value.B32, ==, 1);
    value_assign(&sValue, TYPE_TIME, 1.0);
    munit_assert_int(value_cast(&sValue, TYPE_WORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_WORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint16_t));
    munit_assert_uint16(sValue.Maximum.B16, ==, UINT16_MAX);
    munit_assert_uint16(sValue.Minimum.B16, ==, 0);
    munit_assert_uint16(sValue.Value.B16, ==, 1);
    value_assign(&sValue, TYPE_TIME, 1.0);
    munit_assert_int(value_cast(&sValue, TYPE_BYTE), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_BYTE);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.B8, ==, UINT8_MAX);
    munit_assert_uint8(sValue.Minimum.B8, ==, 0);
    munit_assert_uint8(sValue.Value.B8, ==, 1);
    value_assign(&sValue, TYPE_TIME, 1.0);
    munit_assert_int(value_cast(&sValue, TYPE_BOOL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_BOOL);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.B1, ==, 1);
    munit_assert_uint8(sValue.Minimum.B1, ==, 0);
    munit_assert_uint8(sValue.Value.B1, ==, 1);
    value_assign(&sValue, TYPE_TIME, 1.0);
    munit_assert_int(value_cast(&sValue, TYPE_TIME), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_TIME);
    munit_assert_size(sValue.Length, ==, sizeof(float));
    munit_assert_float(sValue.Maximum.Time, ==, FLT_MAX);
    munit_assert_float(sValue.Minimum.Time, ==, FLT_MIN);
    munit_assert_float(sValue.Value.Time, ==, 1.0);
    value_assign(&sValue, TYPE_TIME, 1.0);
    munit_assert_int(value_cast(&sValue, TYPE_DATE), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DATE);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_assign(&sValue, TYPE_TIME, 1.0);
    munit_assert_int(value_cast(&sValue, TYPE_DT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DT);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_assign(&sValue, TYPE_TIME, 1.0);
    munit_assert_int(value_cast(&sValue, TYPE_TOD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_TOD);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_destroy(&sValue);

    //  TYPE_DATE
    value_initialise(&sValue);
    value_assign(&sValue, TYPE_DATE, 1);
    munit_assert_int(value_cast(&sValue, TYPE_LREAL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LREAL);
    munit_assert_size(sValue.Length, ==, sizeof(double));
    munit_assert_double(sValue.Maximum.Double, ==, DBL_MAX);
    munit_assert_double(sValue.Minimum.Double, ==, DBL_MIN);
    munit_assert_double(sValue.Value.Double, ==, 1.0);
    value_assign(&sValue, TYPE_DATE, 1);
    munit_assert_int(value_cast(&sValue, TYPE_REAL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_REAL);
    munit_assert_size(sValue.Length, ==, sizeof(float));
    munit_assert_float(sValue.Maximum.Single, ==, FLT_MAX);
    munit_assert_float(sValue.Minimum.Single, ==, FLT_MIN);
    munit_assert_float(sValue.Value.Single, ==, 1.0f);
    value_assign(&sValue, TYPE_DATE, 1);
    munit_assert_int(value_cast(&sValue, TYPE_LINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LINT);
    munit_assert_size(sValue.Length, ==, sizeof(int64_t));
    munit_assert_int64(sValue.Maximum.S64, ==, INT64_MAX);
    munit_assert_int64(sValue.Minimum.S64, ==, INT64_MIN);
    munit_assert_int64(sValue.Value.S64, ==, 1);
    value_assign(&sValue, TYPE_DATE, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DINT);
    munit_assert_size(sValue.Length, ==, sizeof(int32_t));
    munit_assert_int32(sValue.Maximum.S32, ==, INT32_MAX);
    munit_assert_int32(sValue.Minimum.S32, ==, INT32_MIN);
    munit_assert_int32(sValue.Value.S32, ==, 1);
    value_assign(&sValue, TYPE_DATE, 1);
    munit_assert_int(value_cast(&sValue, TYPE_INT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_INT);
    munit_assert_size(sValue.Length, ==, sizeof(int16_t));
    munit_assert_int16(sValue.Maximum.S16, ==, INT16_MAX);
    munit_assert_int16(sValue.Minimum.S16, ==, INT16_MIN);
    munit_assert_int16(sValue.Value.S16, ==, 1);
    value_assign(&sValue, TYPE_DATE, 1);
    munit_assert_int(value_cast(&sValue, TYPE_SINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_SINT);
    munit_assert_size(sValue.Length, ==, sizeof(int8_t));
    munit_assert_int8(sValue.Maximum.S8, ==, INT8_MAX);
    munit_assert_int8(sValue.Minimum.S8, ==, INT8_MIN);
    munit_assert_int8(sValue.Value.S8, ==, 1);
    value_assign(&sValue, TYPE_DATE, 1);
    munit_assert_int(value_cast(&sValue, TYPE_ULINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_ULINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint64_t));
    munit_assert_uint64(sValue.Maximum.U64, ==, UINT64_MAX);
    munit_assert_uint64(sValue.Minimum.U64, ==, 0);
    munit_assert_uint64(sValue.Value.U64, ==, 1);
    value_assign(&sValue, TYPE_DATE, 1);
    munit_assert_int(value_cast(&sValue, TYPE_UDINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_UDINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint32_t));
    munit_assert_uint32(sValue.Maximum.U32, ==, UINT32_MAX);
    munit_assert_uint32(sValue.Minimum.U32, ==, 0);
    munit_assert_uint32(sValue.Value.U32, ==, 1);
    value_assign(&sValue, TYPE_DATE, 1);
    munit_assert_int(value_cast(&sValue, TYPE_UINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_UINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint16_t));
    munit_assert_uint16(sValue.Maximum.U16, ==, UINT16_MAX);
    munit_assert_uint16(sValue.Minimum.U16, ==, 0);
    munit_assert_uint16(sValue.Value.U16, ==, 1);
    value_assign(&sValue, TYPE_DATE, 1);
    munit_assert_int(value_cast(&sValue, TYPE_USINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_USINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.U8, ==, UINT8_MAX);
    munit_assert_uint8(sValue.Minimum.U8, ==, 0);
    munit_assert_uint8(sValue.Value.U8, ==, 1);
    value_assign(&sValue, TYPE_DATE, 1);
    munit_assert_int(value_cast(&sValue, TYPE_LWORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LWORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint64_t));
    munit_assert_uint64(sValue.Maximum.B64, ==, UINT64_MAX);
    munit_assert_uint64(sValue.Minimum.B64, ==, 0);
    munit_assert_uint64(sValue.Value.B64, ==, 1);
    value_assign(&sValue, TYPE_DATE, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DWORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DWORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint32_t));
    munit_assert_uint32(sValue.Maximum.B32, ==, UINT32_MAX);
    munit_assert_uint32(sValue.Minimum.B32, ==, 0);
    munit_assert_uint32(sValue.Value.B32, ==, 1);
    value_assign(&sValue, TYPE_DATE, 1);
    munit_assert_int(value_cast(&sValue, TYPE_WORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_WORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint16_t));
    munit_assert_uint16(sValue.Maximum.B16, ==, UINT16_MAX);
    munit_assert_uint16(sValue.Minimum.B16, ==, 0);
    munit_assert_uint16(sValue.Value.B16, ==, 1);
    value_assign(&sValue, TYPE_DATE, 1);
    munit_assert_int(value_cast(&sValue, TYPE_BYTE), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_BYTE);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.B8, ==, UINT8_MAX);
    munit_assert_uint8(sValue.Minimum.B8, ==, 0);
    munit_assert_uint8(sValue.Value.B8, ==, 1);
    value_assign(&sValue, TYPE_DATE, 1);
    munit_assert_int(value_cast(&sValue, TYPE_BOOL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_BOOL);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.B1, ==, 1);
    munit_assert_uint8(sValue.Minimum.B1, ==, 0);
    munit_assert_uint8(sValue.Value.B1, ==, 1);
    value_assign(&sValue, TYPE_DATE, 1);
    munit_assert_int(value_cast(&sValue, TYPE_TIME), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_TIME);
    munit_assert_size(sValue.Length, ==, sizeof(float));
    munit_assert_float(sValue.Maximum.Time, ==, FLT_MAX);
    munit_assert_float(sValue.Minimum.Time, ==, FLT_MIN);
    munit_assert_float(sValue.Value.Time, ==, 1.0);
    value_assign(&sValue, TYPE_DATE, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DATE), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DATE);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_assign(&sValue, TYPE_DATE, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DT);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_assign(&sValue, TYPE_DATE, 1);
    munit_assert_int(value_cast(&sValue, TYPE_TOD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_TOD);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_destroy(&sValue);

    //  TYPE_DT
    value_initialise(&sValue);
    value_assign(&sValue, TYPE_DT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_LREAL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LREAL);
    munit_assert_size(sValue.Length, ==, sizeof(double));
    munit_assert_double(sValue.Maximum.Double, ==, DBL_MAX);
    munit_assert_double(sValue.Minimum.Double, ==, DBL_MIN);
    munit_assert_double(sValue.Value.Double, ==, 1.0);
    value_assign(&sValue, TYPE_DT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_REAL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_REAL);
    munit_assert_size(sValue.Length, ==, sizeof(float));
    munit_assert_float(sValue.Maximum.Single, ==, FLT_MAX);
    munit_assert_float(sValue.Minimum.Single, ==, FLT_MIN);
    munit_assert_float(sValue.Value.Single, ==, 1.0f);
    value_assign(&sValue, TYPE_DT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_LINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LINT);
    munit_assert_size(sValue.Length, ==, sizeof(int64_t));
    munit_assert_int64(sValue.Maximum.S64, ==, INT64_MAX);
    munit_assert_int64(sValue.Minimum.S64, ==, INT64_MIN);
    munit_assert_int64(sValue.Value.S64, ==, 1);
    value_assign(&sValue, TYPE_DT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DINT);
    munit_assert_size(sValue.Length, ==, sizeof(int32_t));
    munit_assert_int32(sValue.Maximum.S32, ==, INT32_MAX);
    munit_assert_int32(sValue.Minimum.S32, ==, INT32_MIN);
    munit_assert_int32(sValue.Value.S32, ==, 1);
    value_assign(&sValue, TYPE_DT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_INT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_INT);
    munit_assert_size(sValue.Length, ==, sizeof(int16_t));
    munit_assert_int16(sValue.Maximum.S16, ==, INT16_MAX);
    munit_assert_int16(sValue.Minimum.S16, ==, INT16_MIN);
    munit_assert_int16(sValue.Value.S16, ==, 1);
    value_assign(&sValue, TYPE_DT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_SINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_SINT);
    munit_assert_size(sValue.Length, ==, sizeof(int8_t));
    munit_assert_int8(sValue.Maximum.S8, ==, INT8_MAX);
    munit_assert_int8(sValue.Minimum.S8, ==, INT8_MIN);
    munit_assert_int8(sValue.Value.S8, ==, 1);
    value_assign(&sValue, TYPE_DT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_ULINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_ULINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint64_t));
    munit_assert_uint64(sValue.Maximum.U64, ==, UINT64_MAX);
    munit_assert_uint64(sValue.Minimum.U64, ==, 0);
    munit_assert_uint64(sValue.Value.U64, ==, 1);
    value_assign(&sValue, TYPE_DT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_UDINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_UDINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint32_t));
    munit_assert_uint32(sValue.Maximum.U32, ==, UINT32_MAX);
    munit_assert_uint32(sValue.Minimum.U32, ==, 0);
    munit_assert_uint32(sValue.Value.U32, ==, 1);
    value_assign(&sValue, TYPE_DT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_UINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_UINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint16_t));
    munit_assert_uint16(sValue.Maximum.U16, ==, UINT16_MAX);
    munit_assert_uint16(sValue.Minimum.U16, ==, 0);
    munit_assert_uint16(sValue.Value.U16, ==, 1);
    value_assign(&sValue, TYPE_DT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_USINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_USINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.U8, ==, UINT8_MAX);
    munit_assert_uint8(sValue.Minimum.U8, ==, 0);
    munit_assert_uint8(sValue.Value.U8, ==, 1);
    value_assign(&sValue, TYPE_DT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_LWORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LWORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint64_t));
    munit_assert_uint64(sValue.Maximum.B64, ==, UINT64_MAX);
    munit_assert_uint64(sValue.Minimum.B64, ==, 0);
    munit_assert_uint64(sValue.Value.B64, ==, 1);
    value_assign(&sValue, TYPE_DT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DWORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DWORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint32_t));
    munit_assert_uint32(sValue.Maximum.B32, ==, UINT32_MAX);
    munit_assert_uint32(sValue.Minimum.B32, ==, 0);
    munit_assert_uint32(sValue.Value.B32, ==, 1);
    value_assign(&sValue, TYPE_DT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_WORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_WORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint16_t));
    munit_assert_uint16(sValue.Maximum.B16, ==, UINT16_MAX);
    munit_assert_uint16(sValue.Minimum.B16, ==, 0);
    munit_assert_uint16(sValue.Value.B16, ==, 1);
    value_assign(&sValue, TYPE_DT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_BYTE), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_BYTE);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.B8, ==, UINT8_MAX);
    munit_assert_uint8(sValue.Minimum.B8, ==, 0);
    munit_assert_uint8(sValue.Value.B8, ==, 1);
    value_assign(&sValue, TYPE_DT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_BOOL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_BOOL);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.B1, ==, 1);
    munit_assert_uint8(sValue.Minimum.B1, ==, 0);
    munit_assert_uint8(sValue.Value.B1, ==, 1);
    value_assign(&sValue, TYPE_DT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_TIME), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_TIME);
    munit_assert_size(sValue.Length, ==, sizeof(float));
    munit_assert_float(sValue.Maximum.Time, ==, FLT_MAX);
    munit_assert_float(sValue.Minimum.Time, ==, FLT_MIN);
    munit_assert_float(sValue.Value.Time, ==, 1.0);
    value_assign(&sValue, TYPE_DT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DATE), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DATE);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_assign(&sValue, TYPE_DT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DT);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_assign(&sValue, TYPE_DT, 1);
    munit_assert_int(value_cast(&sValue, TYPE_TOD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_TOD);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_destroy(&sValue);

    //  TYPE_TOD
    value_initialise(&sValue);
    value_assign(&sValue, TYPE_TOD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_LREAL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LREAL);
    munit_assert_size(sValue.Length, ==, sizeof(double));
    munit_assert_double(sValue.Maximum.Double, ==, DBL_MAX);
    munit_assert_double(sValue.Minimum.Double, ==, DBL_MIN);
    munit_assert_double(sValue.Value.Double, ==, 1.0);
    value_assign(&sValue, TYPE_TOD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_REAL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_REAL);
    munit_assert_size(sValue.Length, ==, sizeof(float));
    munit_assert_float(sValue.Maximum.Single, ==, FLT_MAX);
    munit_assert_float(sValue.Minimum.Single, ==, FLT_MIN);
    munit_assert_float(sValue.Value.Single, ==, 1.0f);
    value_assign(&sValue, TYPE_TOD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_LINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LINT);
    munit_assert_size(sValue.Length, ==, sizeof(int64_t));
    munit_assert_int64(sValue.Maximum.S64, ==, INT64_MAX);
    munit_assert_int64(sValue.Minimum.S64, ==, INT64_MIN);
    munit_assert_int64(sValue.Value.S64, ==, 1);
    value_assign(&sValue, TYPE_TOD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DINT);
    munit_assert_size(sValue.Length, ==, sizeof(int32_t));
    munit_assert_int32(sValue.Maximum.S32, ==, INT32_MAX);
    munit_assert_int32(sValue.Minimum.S32, ==, INT32_MIN);
    munit_assert_int32(sValue.Value.S32, ==, 1);
    value_assign(&sValue, TYPE_TOD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_INT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_INT);
    munit_assert_size(sValue.Length, ==, sizeof(int16_t));
    munit_assert_int16(sValue.Maximum.S16, ==, INT16_MAX);
    munit_assert_int16(sValue.Minimum.S16, ==, INT16_MIN);
    munit_assert_int16(sValue.Value.S16, ==, 1);
    value_assign(&sValue, TYPE_TOD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_SINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_SINT);
    munit_assert_size(sValue.Length, ==, sizeof(int8_t));
    munit_assert_int8(sValue.Maximum.S8, ==, INT8_MAX);
    munit_assert_int8(sValue.Minimum.S8, ==, INT8_MIN);
    munit_assert_int8(sValue.Value.S8, ==, 1);
    value_assign(&sValue, TYPE_TOD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_ULINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_ULINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint64_t));
    munit_assert_uint64(sValue.Maximum.U64, ==, UINT64_MAX);
    munit_assert_uint64(sValue.Minimum.U64, ==, 0);
    munit_assert_uint64(sValue.Value.U64, ==, 1);
    value_assign(&sValue, TYPE_TOD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_UDINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_UDINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint32_t));
    munit_assert_uint32(sValue.Maximum.U32, ==, UINT32_MAX);
    munit_assert_uint32(sValue.Minimum.U32, ==, 0);
    munit_assert_uint32(sValue.Value.U32, ==, 1);
    value_assign(&sValue, TYPE_TOD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_UINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_UINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint16_t));
    munit_assert_uint16(sValue.Maximum.U16, ==, UINT16_MAX);
    munit_assert_uint16(sValue.Minimum.U16, ==, 0);
    munit_assert_uint16(sValue.Value.U16, ==, 1);
    value_assign(&sValue, TYPE_TOD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_USINT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_USINT);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.U8, ==, UINT8_MAX);
    munit_assert_uint8(sValue.Minimum.U8, ==, 0);
    munit_assert_uint8(sValue.Value.U8, ==, 1);
    value_assign(&sValue, TYPE_TOD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_LWORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_LWORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint64_t));
    munit_assert_uint64(sValue.Maximum.B64, ==, UINT64_MAX);
    munit_assert_uint64(sValue.Minimum.B64, ==, 0);
    munit_assert_uint64(sValue.Value.B64, ==, 1);
    value_assign(&sValue, TYPE_TOD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DWORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DWORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint32_t));
    munit_assert_uint32(sValue.Maximum.B32, ==, UINT32_MAX);
    munit_assert_uint32(sValue.Minimum.B32, ==, 0);
    munit_assert_uint32(sValue.Value.B32, ==, 1);
    value_assign(&sValue, TYPE_TOD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_WORD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_WORD);
    munit_assert_size(sValue.Length, ==, sizeof(uint16_t));
    munit_assert_uint16(sValue.Maximum.B16, ==, UINT16_MAX);
    munit_assert_uint16(sValue.Minimum.B16, ==, 0);
    munit_assert_uint16(sValue.Value.B16, ==, 1);
    value_assign(&sValue, TYPE_TOD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_BYTE), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_BYTE);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.B8, ==, UINT8_MAX);
    munit_assert_uint8(sValue.Minimum.B8, ==, 0);
    munit_assert_uint8(sValue.Value.B8, ==, 1);
    value_assign(&sValue, TYPE_TOD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_BOOL), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_BOOL);
    munit_assert_size(sValue.Length, ==, sizeof(uint8_t));
    munit_assert_uint8(sValue.Maximum.B1, ==, 1);
    munit_assert_uint8(sValue.Minimum.B1, ==, 0);
    munit_assert_uint8(sValue.Value.B1, ==, 1);
    value_assign(&sValue, TYPE_TOD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_TIME), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_TIME);
    munit_assert_size(sValue.Length, ==, sizeof(float));
    munit_assert_float(sValue.Maximum.Time, ==, FLT_MAX);
    munit_assert_float(sValue.Minimum.Time, ==, FLT_MIN);
    munit_assert_float(sValue.Value.Time, ==, 1.0);
    value_assign(&sValue, TYPE_TOD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DATE), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DATE);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_assign(&sValue, TYPE_TOD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_DT), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_DT);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_assign(&sValue, TYPE_TOD, 1);
    munit_assert_int(value_cast(&sValue, TYPE_TOD), ==, 0);
    munit_assert_uint32(sValue.Type, ==, TYPE_TOD);
    munit_assert_size(sValue.Length, ==, sizeof(time_t));
    munit_assert_float(sValue.Maximum.DateTime, ==, 0);
    munit_assert_float(sValue.Minimum.DateTime, ==, 0);
    munit_assert_float(sValue.Value.DateTime, ==, 1);
    value_destroy(&sValue);

    return MUNIT_OK;
}

