#include <stdio.h>
#include <string.h>

#include <munit/munit.h>

#include <value.h>


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

    //  TYPE_LREAL
    value_assign(&sValue, TYPE_LREAL);
    munit_assert_true(value_istype(&sValue, ANY_ELEMENTARY));
    munit_assert_true(value_istype(&sValue, ANY_MAGNITUDE));
    munit_assert_true(value_istype(&sValue, ANY_NUM));
    munit_assert_true(value_istype(&sValue, ANY_REAL));
    munit_assert_true(value_istype(&sValue, TYPE_LREAL));
    munit_assert_false(value_istype(&sValue, TYPE_REAL));
    munit_assert_false(value_istype(&sValue, ANY_INT));
    munit_assert_false(value_istype(&sValue, TYPE_LINT));
    munit_assert_false(value_istype(&sValue, TYPE_DINT));
    munit_assert_false(value_istype(&sValue, TYPE_INT));
    munit_assert_false(value_istype(&sValue, TYPE_SINT));
    munit_assert_false(value_istype(&sValue, TYPE_ULINT));
    munit_assert_false(value_istype(&sValue, TYPE_UDINT));
    munit_assert_false(value_istype(&sValue, TYPE_UINT));
    munit_assert_false(value_istype(&sValue, TYPE_USINT));
    munit_assert_false(value_istype(&sValue, ANY_BIT));
    munit_assert_false(value_istype(&sValue, TYPE_LWORD));
    munit_assert_false(value_istype(&sValue, TYPE_DWORD));
    munit_assert_false(value_istype(&sValue, TYPE_WORD));
    munit_assert_false(value_istype(&sValue, TYPE_BYTE));
    munit_assert_false(value_istype(&sValue, TYPE_BOOL));
    munit_assert_false(value_istype(&sValue, TYPE_TIME));
    munit_assert_false(value_istype(&sValue, TYPE_DATE));
    munit_assert_false(value_istype(&sValue, TYPE_DT));
    munit_assert_false(value_istype(&sValue, TYPE_TOD));
    munit_assert_false(value_istype(&sValue, ANY_STRING));
    munit_assert_false(value_istype(&sValue, TYPE_STRING));
    munit_assert_false(value_istype(&sValue, TYPE_WSTRING));
    value_destroy(&sValue);

    //  TYPE_REAL
    value_assign(&sValue, TYPE_REAL);
    munit_assert_true(value_istype(&sValue, ANY_ELEMENTARY));
    munit_assert_true(value_istype(&sValue, ANY_MAGNITUDE));
    munit_assert_true(value_istype(&sValue, ANY_NUM));
    munit_assert_true(value_istype(&sValue, ANY_REAL));
    munit_assert_false(value_istype(&sValue, TYPE_LREAL));
    munit_assert_true(value_istype(&sValue, TYPE_REAL));
    munit_assert_false(value_istype(&sValue, ANY_INT));
    munit_assert_false(value_istype(&sValue, TYPE_LINT));
    munit_assert_false(value_istype(&sValue, TYPE_DINT));
    munit_assert_false(value_istype(&sValue, TYPE_INT));
    munit_assert_false(value_istype(&sValue, TYPE_SINT));
    munit_assert_false(value_istype(&sValue, TYPE_ULINT));
    munit_assert_false(value_istype(&sValue, TYPE_UDINT));
    munit_assert_false(value_istype(&sValue, TYPE_UINT));
    munit_assert_false(value_istype(&sValue, TYPE_USINT));
    munit_assert_false(value_istype(&sValue, ANY_BIT));
    munit_assert_false(value_istype(&sValue, TYPE_LWORD));
    munit_assert_false(value_istype(&sValue, TYPE_DWORD));
    munit_assert_false(value_istype(&sValue, TYPE_WORD));
    munit_assert_false(value_istype(&sValue, TYPE_BYTE));
    munit_assert_false(value_istype(&sValue, TYPE_BOOL));
    munit_assert_false(value_istype(&sValue, TYPE_TIME));
    munit_assert_false(value_istype(&sValue, TYPE_DATE));
    munit_assert_false(value_istype(&sValue, TYPE_DT));
    munit_assert_false(value_istype(&sValue, TYPE_TOD));
    munit_assert_false(value_istype(&sValue, ANY_STRING));
    munit_assert_false(value_istype(&sValue, TYPE_STRING));
    munit_assert_false(value_istype(&sValue, TYPE_WSTRING));
    value_destroy(&sValue);

    //  TYPE_LINT
    value_assign(&sValue, TYPE_LINT);
    munit_assert_true(value_istype(&sValue, ANY_ELEMENTARY));
    munit_assert_true(value_istype(&sValue, ANY_MAGNITUDE));
    munit_assert_true(value_istype(&sValue, ANY_NUM));
    munit_assert_false(value_istype(&sValue, ANY_REAL));
    munit_assert_false(value_istype(&sValue, TYPE_LREAL));
    munit_assert_false(value_istype(&sValue, TYPE_REAL));
    munit_assert_true(value_istype(&sValue, ANY_INT));
    munit_assert_true(value_istype(&sValue, TYPE_LINT));
    munit_assert_false(value_istype(&sValue, TYPE_DINT));
    munit_assert_false(value_istype(&sValue, TYPE_INT));
    munit_assert_false(value_istype(&sValue, TYPE_SINT));
    munit_assert_false(value_istype(&sValue, TYPE_ULINT));
    munit_assert_false(value_istype(&sValue, TYPE_UDINT));
    munit_assert_false(value_istype(&sValue, TYPE_UINT));
    munit_assert_false(value_istype(&sValue, TYPE_USINT));
    munit_assert_false(value_istype(&sValue, ANY_BIT));
    munit_assert_false(value_istype(&sValue, TYPE_LWORD));
    munit_assert_false(value_istype(&sValue, TYPE_DWORD));
    munit_assert_false(value_istype(&sValue, TYPE_WORD));
    munit_assert_false(value_istype(&sValue, TYPE_BYTE));
    munit_assert_false(value_istype(&sValue, TYPE_BOOL));
    munit_assert_false(value_istype(&sValue, TYPE_TIME));
    munit_assert_false(value_istype(&sValue, TYPE_DATE));
    munit_assert_false(value_istype(&sValue, TYPE_DT));
    munit_assert_false(value_istype(&sValue, TYPE_TOD));
    munit_assert_false(value_istype(&sValue, ANY_STRING));
    munit_assert_false(value_istype(&sValue, TYPE_STRING));
    munit_assert_false(value_istype(&sValue, TYPE_WSTRING));
    value_destroy(&sValue);

    //  TYPE_DINT
    value_assign(&sValue, TYPE_DINT);
    munit_assert_true(value_istype(&sValue, ANY_ELEMENTARY));
    munit_assert_true(value_istype(&sValue, ANY_MAGNITUDE));
    munit_assert_true(value_istype(&sValue, ANY_NUM));
    munit_assert_false(value_istype(&sValue, ANY_REAL));
    munit_assert_false(value_istype(&sValue, TYPE_LREAL));
    munit_assert_false(value_istype(&sValue, TYPE_REAL));
    munit_assert_true(value_istype(&sValue, ANY_INT));
    munit_assert_false(value_istype(&sValue, TYPE_LINT));
    munit_assert_true(value_istype(&sValue, TYPE_DINT));
    munit_assert_false(value_istype(&sValue, TYPE_INT));
    munit_assert_false(value_istype(&sValue, TYPE_SINT));
    munit_assert_false(value_istype(&sValue, TYPE_ULINT));
    munit_assert_false(value_istype(&sValue, TYPE_UDINT));
    munit_assert_false(value_istype(&sValue, TYPE_UINT));
    munit_assert_false(value_istype(&sValue, TYPE_USINT));
    munit_assert_false(value_istype(&sValue, ANY_BIT));
    munit_assert_false(value_istype(&sValue, TYPE_LWORD));
    munit_assert_false(value_istype(&sValue, TYPE_DWORD));
    munit_assert_false(value_istype(&sValue, TYPE_WORD));
    munit_assert_false(value_istype(&sValue, TYPE_BYTE));
    munit_assert_false(value_istype(&sValue, TYPE_BOOL));
    munit_assert_false(value_istype(&sValue, TYPE_TIME));
    munit_assert_false(value_istype(&sValue, TYPE_DATE));
    munit_assert_false(value_istype(&sValue, TYPE_DT));
    munit_assert_false(value_istype(&sValue, TYPE_TOD));
    munit_assert_false(value_istype(&sValue, ANY_STRING));
    munit_assert_false(value_istype(&sValue, TYPE_STRING));
    munit_assert_false(value_istype(&sValue, TYPE_WSTRING));
    value_destroy(&sValue);

    //  TYPE_INT
    value_assign(&sValue, TYPE_INT);
    munit_assert_true(value_istype(&sValue, ANY_ELEMENTARY));
    munit_assert_true(value_istype(&sValue, ANY_MAGNITUDE));
    munit_assert_true(value_istype(&sValue, ANY_NUM));
    munit_assert_false(value_istype(&sValue, ANY_REAL));
    munit_assert_false(value_istype(&sValue, TYPE_LREAL));
    munit_assert_false(value_istype(&sValue, TYPE_REAL));
    munit_assert_true(value_istype(&sValue, ANY_INT));
    munit_assert_false(value_istype(&sValue, TYPE_LINT));
    munit_assert_false(value_istype(&sValue, TYPE_DINT));
    munit_assert_true(value_istype(&sValue, TYPE_INT));
    munit_assert_false(value_istype(&sValue, TYPE_SINT));
    munit_assert_false(value_istype(&sValue, TYPE_ULINT));
    munit_assert_false(value_istype(&sValue, TYPE_UDINT));
    munit_assert_false(value_istype(&sValue, TYPE_UINT));
    munit_assert_false(value_istype(&sValue, TYPE_USINT));
    munit_assert_false(value_istype(&sValue, ANY_BIT));
    munit_assert_false(value_istype(&sValue, TYPE_LWORD));
    munit_assert_false(value_istype(&sValue, TYPE_DWORD));
    munit_assert_false(value_istype(&sValue, TYPE_WORD));
    munit_assert_false(value_istype(&sValue, TYPE_BYTE));
    munit_assert_false(value_istype(&sValue, TYPE_BOOL));
    munit_assert_false(value_istype(&sValue, TYPE_TIME));
    munit_assert_false(value_istype(&sValue, TYPE_DATE));
    munit_assert_false(value_istype(&sValue, TYPE_DT));
    munit_assert_false(value_istype(&sValue, TYPE_TOD));
    munit_assert_false(value_istype(&sValue, ANY_STRING));
    munit_assert_false(value_istype(&sValue, TYPE_STRING));
    munit_assert_false(value_istype(&sValue, TYPE_WSTRING));
    value_destroy(&sValue);

    //  TYPE_SINT
    value_assign(&sValue, TYPE_SINT);
    munit_assert_true(value_istype(&sValue, ANY_ELEMENTARY));
    munit_assert_true(value_istype(&sValue, ANY_MAGNITUDE));
    munit_assert_true(value_istype(&sValue, ANY_NUM));
    munit_assert_false(value_istype(&sValue, ANY_REAL));
    munit_assert_false(value_istype(&sValue, TYPE_LREAL));
    munit_assert_false(value_istype(&sValue, TYPE_REAL));
    munit_assert_true(value_istype(&sValue, ANY_INT));
    munit_assert_false(value_istype(&sValue, TYPE_LINT));
    munit_assert_false(value_istype(&sValue, TYPE_DINT));
    munit_assert_false(value_istype(&sValue, TYPE_INT));
    munit_assert_true(value_istype(&sValue, TYPE_SINT));
    munit_assert_false(value_istype(&sValue, TYPE_ULINT));
    munit_assert_false(value_istype(&sValue, TYPE_UDINT));
    munit_assert_false(value_istype(&sValue, TYPE_UINT));
    munit_assert_false(value_istype(&sValue, TYPE_USINT));
    munit_assert_false(value_istype(&sValue, ANY_BIT));
    munit_assert_false(value_istype(&sValue, TYPE_LWORD));
    munit_assert_false(value_istype(&sValue, TYPE_DWORD));
    munit_assert_false(value_istype(&sValue, TYPE_WORD));
    munit_assert_false(value_istype(&sValue, TYPE_BYTE));
    munit_assert_false(value_istype(&sValue, TYPE_BOOL));
    munit_assert_false(value_istype(&sValue, TYPE_TIME));
    munit_assert_false(value_istype(&sValue, TYPE_DATE));
    munit_assert_false(value_istype(&sValue, TYPE_DT));
    munit_assert_false(value_istype(&sValue, TYPE_TOD));
    munit_assert_false(value_istype(&sValue, ANY_STRING));
    munit_assert_false(value_istype(&sValue, TYPE_STRING));
    munit_assert_false(value_istype(&sValue, TYPE_WSTRING));
    value_destroy(&sValue);

    //  TYPE_ULINT
    value_assign(&sValue, TYPE_ULINT);
    munit_assert_true(value_istype(&sValue, ANY_ELEMENTARY));
    munit_assert_true(value_istype(&sValue, ANY_MAGNITUDE));
    munit_assert_true(value_istype(&sValue, ANY_NUM));
    munit_assert_false(value_istype(&sValue, ANY_REAL));
    munit_assert_false(value_istype(&sValue, TYPE_LREAL));
    munit_assert_false(value_istype(&sValue, TYPE_REAL));
    munit_assert_true(value_istype(&sValue, ANY_INT));
    munit_assert_false(value_istype(&sValue, TYPE_LINT));
    munit_assert_false(value_istype(&sValue, TYPE_DINT));
    munit_assert_false(value_istype(&sValue, TYPE_INT));
    munit_assert_false(value_istype(&sValue, TYPE_SINT));
    munit_assert_true(value_istype(&sValue, TYPE_ULINT));
    munit_assert_false(value_istype(&sValue, TYPE_UDINT));
    munit_assert_false(value_istype(&sValue, TYPE_UINT));
    munit_assert_false(value_istype(&sValue, TYPE_USINT));
    munit_assert_false(value_istype(&sValue, ANY_BIT));
    munit_assert_false(value_istype(&sValue, TYPE_LWORD));
    munit_assert_false(value_istype(&sValue, TYPE_DWORD));
    munit_assert_false(value_istype(&sValue, TYPE_WORD));
    munit_assert_false(value_istype(&sValue, TYPE_BYTE));
    munit_assert_false(value_istype(&sValue, TYPE_BOOL));
    munit_assert_false(value_istype(&sValue, TYPE_TIME));
    munit_assert_false(value_istype(&sValue, TYPE_DATE));
    munit_assert_false(value_istype(&sValue, TYPE_DT));
    munit_assert_false(value_istype(&sValue, TYPE_TOD));
    munit_assert_false(value_istype(&sValue, ANY_STRING));
    munit_assert_false(value_istype(&sValue, TYPE_STRING));
    munit_assert_false(value_istype(&sValue, TYPE_WSTRING));
    value_destroy(&sValue);

    //  TYPE_UDINT
    value_assign(&sValue, TYPE_UDINT);
    munit_assert_true(value_istype(&sValue, ANY_ELEMENTARY));
    munit_assert_true(value_istype(&sValue, ANY_MAGNITUDE));
    munit_assert_true(value_istype(&sValue, ANY_NUM));
    munit_assert_false(value_istype(&sValue, ANY_REAL));
    munit_assert_false(value_istype(&sValue, TYPE_LREAL));
    munit_assert_false(value_istype(&sValue, TYPE_REAL));
    munit_assert_true(value_istype(&sValue, ANY_INT));
    munit_assert_false(value_istype(&sValue, TYPE_LINT));
    munit_assert_false(value_istype(&sValue, TYPE_DINT));
    munit_assert_false(value_istype(&sValue, TYPE_INT));
    munit_assert_false(value_istype(&sValue, TYPE_SINT));
    munit_assert_false(value_istype(&sValue, TYPE_ULINT));
    munit_assert_true(value_istype(&sValue, TYPE_UDINT));
    munit_assert_false(value_istype(&sValue, TYPE_UINT));
    munit_assert_false(value_istype(&sValue, TYPE_USINT));
    munit_assert_false(value_istype(&sValue, ANY_BIT));
    munit_assert_false(value_istype(&sValue, TYPE_LWORD));
    munit_assert_false(value_istype(&sValue, TYPE_DWORD));
    munit_assert_false(value_istype(&sValue, TYPE_WORD));
    munit_assert_false(value_istype(&sValue, TYPE_BYTE));
    munit_assert_false(value_istype(&sValue, TYPE_BOOL));
    munit_assert_false(value_istype(&sValue, TYPE_TIME));
    munit_assert_false(value_istype(&sValue, TYPE_DATE));
    munit_assert_false(value_istype(&sValue, TYPE_DT));
    munit_assert_false(value_istype(&sValue, TYPE_TOD));
    munit_assert_false(value_istype(&sValue, ANY_STRING));
    munit_assert_false(value_istype(&sValue, TYPE_STRING));
    munit_assert_false(value_istype(&sValue, TYPE_WSTRING));
    value_destroy(&sValue);

    //  TYPE_UINT
    value_assign(&sValue, TYPE_UINT);
    munit_assert_true(value_istype(&sValue, ANY_ELEMENTARY));
    munit_assert_true(value_istype(&sValue, ANY_MAGNITUDE));
    munit_assert_true(value_istype(&sValue, ANY_NUM));
    munit_assert_false(value_istype(&sValue, ANY_REAL));
    munit_assert_false(value_istype(&sValue, TYPE_LREAL));
    munit_assert_false(value_istype(&sValue, TYPE_REAL));
    munit_assert_true(value_istype(&sValue, ANY_INT));
    munit_assert_false(value_istype(&sValue, TYPE_LINT));
    munit_assert_false(value_istype(&sValue, TYPE_DINT));
    munit_assert_false(value_istype(&sValue, TYPE_INT));
    munit_assert_false(value_istype(&sValue, TYPE_SINT));
    munit_assert_false(value_istype(&sValue, TYPE_ULINT));
    munit_assert_false(value_istype(&sValue, TYPE_UDINT));
    munit_assert_true(value_istype(&sValue, TYPE_UINT));
    munit_assert_false(value_istype(&sValue, TYPE_USINT));
    munit_assert_false(value_istype(&sValue, ANY_BIT));
    munit_assert_false(value_istype(&sValue, TYPE_LWORD));
    munit_assert_false(value_istype(&sValue, TYPE_DWORD));
    munit_assert_false(value_istype(&sValue, TYPE_WORD));
    munit_assert_false(value_istype(&sValue, TYPE_BYTE));
    munit_assert_false(value_istype(&sValue, TYPE_BOOL));
    munit_assert_false(value_istype(&sValue, TYPE_TIME));
    munit_assert_false(value_istype(&sValue, TYPE_DATE));
    munit_assert_false(value_istype(&sValue, TYPE_DT));
    munit_assert_false(value_istype(&sValue, TYPE_TOD));
    munit_assert_false(value_istype(&sValue, ANY_STRING));
    munit_assert_false(value_istype(&sValue, TYPE_STRING));
    munit_assert_false(value_istype(&sValue, TYPE_WSTRING));
    value_destroy(&sValue);

    //  TYPE_USINT
    value_assign(&sValue, TYPE_USINT);
    munit_assert_true(value_istype(&sValue, ANY_ELEMENTARY));
    munit_assert_true(value_istype(&sValue, ANY_MAGNITUDE));
    munit_assert_true(value_istype(&sValue, ANY_NUM));
    munit_assert_false(value_istype(&sValue, ANY_REAL));
    munit_assert_false(value_istype(&sValue, TYPE_LREAL));
    munit_assert_false(value_istype(&sValue, TYPE_REAL));
    munit_assert_true(value_istype(&sValue, ANY_INT));
    munit_assert_false(value_istype(&sValue, TYPE_LINT));
    munit_assert_false(value_istype(&sValue, TYPE_DINT));
    munit_assert_false(value_istype(&sValue, TYPE_INT));
    munit_assert_false(value_istype(&sValue, TYPE_SINT));
    munit_assert_false(value_istype(&sValue, TYPE_ULINT));
    munit_assert_false(value_istype(&sValue, TYPE_UDINT));
    munit_assert_false(value_istype(&sValue, TYPE_UINT));
    munit_assert_true(value_istype(&sValue, TYPE_USINT));
    munit_assert_false(value_istype(&sValue, ANY_BIT));
    munit_assert_false(value_istype(&sValue, TYPE_LWORD));
    munit_assert_false(value_istype(&sValue, TYPE_DWORD));
    munit_assert_false(value_istype(&sValue, TYPE_WORD));
    munit_assert_false(value_istype(&sValue, TYPE_BYTE));
    munit_assert_false(value_istype(&sValue, TYPE_BOOL));
    munit_assert_false(value_istype(&sValue, TYPE_TIME));
    munit_assert_false(value_istype(&sValue, TYPE_DATE));
    munit_assert_false(value_istype(&sValue, TYPE_DT));
    munit_assert_false(value_istype(&sValue, TYPE_TOD));
    munit_assert_false(value_istype(&sValue, ANY_STRING));
    munit_assert_false(value_istype(&sValue, TYPE_STRING));
    munit_assert_false(value_istype(&sValue, TYPE_WSTRING));
    value_destroy(&sValue);

    //  TYPE_LWORD
    value_assign(&sValue, TYPE_LWORD);
    munit_assert_true(value_istype(&sValue, ANY_ELEMENTARY));
    munit_assert_false(value_istype(&sValue, ANY_MAGNITUDE));
    munit_assert_false(value_istype(&sValue, ANY_NUM));
    munit_assert_false(value_istype(&sValue, ANY_REAL));
    munit_assert_false(value_istype(&sValue, TYPE_LREAL));
    munit_assert_false(value_istype(&sValue, TYPE_REAL));
    munit_assert_false(value_istype(&sValue, ANY_INT));
    munit_assert_false(value_istype(&sValue, TYPE_LINT));
    munit_assert_false(value_istype(&sValue, TYPE_DINT));
    munit_assert_false(value_istype(&sValue, TYPE_INT));
    munit_assert_false(value_istype(&sValue, TYPE_SINT));
    munit_assert_false(value_istype(&sValue, TYPE_ULINT));
    munit_assert_false(value_istype(&sValue, TYPE_UDINT));
    munit_assert_false(value_istype(&sValue, TYPE_UINT));
    munit_assert_false(value_istype(&sValue, TYPE_USINT));
    munit_assert_true(value_istype(&sValue, ANY_BIT));
    munit_assert_true(value_istype(&sValue, TYPE_LWORD));
    munit_assert_false(value_istype(&sValue, TYPE_DWORD));
    munit_assert_false(value_istype(&sValue, TYPE_WORD));
    munit_assert_false(value_istype(&sValue, TYPE_BYTE));
    munit_assert_false(value_istype(&sValue, TYPE_BOOL));
    munit_assert_false(value_istype(&sValue, TYPE_TIME));
    munit_assert_false(value_istype(&sValue, TYPE_DATE));
    munit_assert_false(value_istype(&sValue, TYPE_DT));
    munit_assert_false(value_istype(&sValue, TYPE_TOD));
    munit_assert_false(value_istype(&sValue, ANY_STRING));
    munit_assert_false(value_istype(&sValue, TYPE_STRING));
    munit_assert_false(value_istype(&sValue, TYPE_WSTRING));
    value_destroy(&sValue);

    //  TYPE_DWORD
    value_assign(&sValue, TYPE_DWORD);
    munit_assert_true(value_istype(&sValue, ANY_ELEMENTARY));
    munit_assert_false(value_istype(&sValue, ANY_MAGNITUDE));
    munit_assert_false(value_istype(&sValue, ANY_NUM));
    munit_assert_false(value_istype(&sValue, ANY_REAL));
    munit_assert_false(value_istype(&sValue, TYPE_LREAL));
    munit_assert_false(value_istype(&sValue, TYPE_REAL));
    munit_assert_false(value_istype(&sValue, ANY_INT));
    munit_assert_false(value_istype(&sValue, TYPE_LINT));
    munit_assert_false(value_istype(&sValue, TYPE_DINT));
    munit_assert_false(value_istype(&sValue, TYPE_INT));
    munit_assert_false(value_istype(&sValue, TYPE_SINT));
    munit_assert_false(value_istype(&sValue, TYPE_ULINT));
    munit_assert_false(value_istype(&sValue, TYPE_UDINT));
    munit_assert_false(value_istype(&sValue, TYPE_UINT));
    munit_assert_false(value_istype(&sValue, TYPE_USINT));
    munit_assert_true(value_istype(&sValue, ANY_BIT));
    munit_assert_false(value_istype(&sValue, TYPE_LWORD));
    munit_assert_true(value_istype(&sValue, TYPE_DWORD));
    munit_assert_false(value_istype(&sValue, TYPE_WORD));
    munit_assert_false(value_istype(&sValue, TYPE_BYTE));
    munit_assert_false(value_istype(&sValue, TYPE_BOOL));
    munit_assert_false(value_istype(&sValue, TYPE_TIME));
    munit_assert_false(value_istype(&sValue, TYPE_DATE));
    munit_assert_false(value_istype(&sValue, TYPE_DT));
    munit_assert_false(value_istype(&sValue, TYPE_TOD));
    munit_assert_false(value_istype(&sValue, ANY_STRING));
    munit_assert_false(value_istype(&sValue, TYPE_STRING));
    munit_assert_false(value_istype(&sValue, TYPE_WSTRING));
    value_destroy(&sValue);

    //  TYPE_WORD
    value_assign(&sValue, TYPE_WORD);
    munit_assert_true(value_istype(&sValue, ANY_ELEMENTARY));
    munit_assert_false(value_istype(&sValue, ANY_MAGNITUDE));
    munit_assert_false(value_istype(&sValue, ANY_NUM));
    munit_assert_false(value_istype(&sValue, ANY_REAL));
    munit_assert_false(value_istype(&sValue, TYPE_LREAL));
    munit_assert_false(value_istype(&sValue, TYPE_REAL));
    munit_assert_false(value_istype(&sValue, ANY_INT));
    munit_assert_false(value_istype(&sValue, TYPE_LINT));
    munit_assert_false(value_istype(&sValue, TYPE_DINT));
    munit_assert_false(value_istype(&sValue, TYPE_INT));
    munit_assert_false(value_istype(&sValue, TYPE_SINT));
    munit_assert_false(value_istype(&sValue, TYPE_ULINT));
    munit_assert_false(value_istype(&sValue, TYPE_UDINT));
    munit_assert_false(value_istype(&sValue, TYPE_UINT));
    munit_assert_false(value_istype(&sValue, TYPE_USINT));
    munit_assert_true(value_istype(&sValue, ANY_BIT));
    munit_assert_false(value_istype(&sValue, TYPE_LWORD));
    munit_assert_false(value_istype(&sValue, TYPE_DWORD));
    munit_assert_true(value_istype(&sValue, TYPE_WORD));
    munit_assert_false(value_istype(&sValue, TYPE_BYTE));
    munit_assert_false(value_istype(&sValue, TYPE_BOOL));
    munit_assert_false(value_istype(&sValue, TYPE_TIME));
    munit_assert_false(value_istype(&sValue, TYPE_DATE));
    munit_assert_false(value_istype(&sValue, TYPE_DT));
    munit_assert_false(value_istype(&sValue, TYPE_TOD));
    munit_assert_false(value_istype(&sValue, ANY_STRING));
    munit_assert_false(value_istype(&sValue, TYPE_STRING));
    munit_assert_false(value_istype(&sValue, TYPE_WSTRING));
    value_destroy(&sValue);

    //  TYPE_BYTE
    value_assign(&sValue, TYPE_BYTE);
    munit_assert_true(value_istype(&sValue, ANY_ELEMENTARY));
    munit_assert_false(value_istype(&sValue, ANY_MAGNITUDE));
    munit_assert_false(value_istype(&sValue, ANY_NUM));
    munit_assert_false(value_istype(&sValue, ANY_REAL));
    munit_assert_false(value_istype(&sValue, TYPE_LREAL));
    munit_assert_false(value_istype(&sValue, TYPE_REAL));
    munit_assert_false(value_istype(&sValue, ANY_INT));
    munit_assert_false(value_istype(&sValue, TYPE_LINT));
    munit_assert_false(value_istype(&sValue, TYPE_DINT));
    munit_assert_false(value_istype(&sValue, TYPE_INT));
    munit_assert_false(value_istype(&sValue, TYPE_SINT));
    munit_assert_false(value_istype(&sValue, TYPE_ULINT));
    munit_assert_false(value_istype(&sValue, TYPE_UDINT));
    munit_assert_false(value_istype(&sValue, TYPE_UINT));
    munit_assert_false(value_istype(&sValue, TYPE_USINT));
    munit_assert_true(value_istype(&sValue, ANY_BIT));
    munit_assert_false(value_istype(&sValue, TYPE_LWORD));
    munit_assert_false(value_istype(&sValue, TYPE_DWORD));
    munit_assert_false(value_istype(&sValue, TYPE_WORD));
    munit_assert_true(value_istype(&sValue, TYPE_BYTE));
    munit_assert_false(value_istype(&sValue, TYPE_BOOL));
    munit_assert_false(value_istype(&sValue, TYPE_TIME));
    munit_assert_false(value_istype(&sValue, TYPE_DATE));
    munit_assert_false(value_istype(&sValue, TYPE_DT));
    munit_assert_false(value_istype(&sValue, TYPE_TOD));
    munit_assert_false(value_istype(&sValue, ANY_STRING));
    munit_assert_false(value_istype(&sValue, TYPE_STRING));
    munit_assert_false(value_istype(&sValue, TYPE_WSTRING));
    value_destroy(&sValue);

    //  TYPE_BOOL
    value_assign(&sValue, TYPE_BOOL);
    munit_assert_true(value_istype(&sValue, ANY_ELEMENTARY));
    munit_assert_false(value_istype(&sValue, ANY_MAGNITUDE));
    munit_assert_false(value_istype(&sValue, ANY_NUM));
    munit_assert_false(value_istype(&sValue, ANY_REAL));
    munit_assert_false(value_istype(&sValue, TYPE_LREAL));
    munit_assert_false(value_istype(&sValue, TYPE_REAL));
    munit_assert_false(value_istype(&sValue, ANY_INT));
    munit_assert_false(value_istype(&sValue, TYPE_LINT));
    munit_assert_false(value_istype(&sValue, TYPE_DINT));
    munit_assert_false(value_istype(&sValue, TYPE_INT));
    munit_assert_false(value_istype(&sValue, TYPE_SINT));
    munit_assert_false(value_istype(&sValue, TYPE_ULINT));
    munit_assert_false(value_istype(&sValue, TYPE_UDINT));
    munit_assert_false(value_istype(&sValue, TYPE_UINT));
    munit_assert_false(value_istype(&sValue, TYPE_USINT));
    munit_assert_true(value_istype(&sValue, ANY_BIT));
    munit_assert_false(value_istype(&sValue, TYPE_LWORD));
    munit_assert_false(value_istype(&sValue, TYPE_DWORD));
    munit_assert_false(value_istype(&sValue, TYPE_WORD));
    munit_assert_false(value_istype(&sValue, TYPE_BYTE));
    munit_assert_true(value_istype(&sValue, TYPE_BOOL));
    munit_assert_false(value_istype(&sValue, TYPE_TIME));
    munit_assert_false(value_istype(&sValue, TYPE_DATE));
    munit_assert_false(value_istype(&sValue, TYPE_DT));
    munit_assert_false(value_istype(&sValue, TYPE_TOD));
    munit_assert_false(value_istype(&sValue, ANY_STRING));
    munit_assert_false(value_istype(&sValue, TYPE_STRING));
    munit_assert_false(value_istype(&sValue, TYPE_WSTRING));
    value_destroy(&sValue);

    //  TYPE_TIME
    value_assign(&sValue, TYPE_TIME);
    munit_assert_true(value_istype(&sValue, ANY_ELEMENTARY));
    munit_assert_true(value_istype(&sValue, ANY_MAGNITUDE));
    munit_assert_false(value_istype(&sValue, ANY_NUM));
    munit_assert_false(value_istype(&sValue, ANY_REAL));
    munit_assert_false(value_istype(&sValue, TYPE_LREAL));
    munit_assert_false(value_istype(&sValue, TYPE_REAL));
    munit_assert_false(value_istype(&sValue, ANY_INT));
    munit_assert_false(value_istype(&sValue, TYPE_LINT));
    munit_assert_false(value_istype(&sValue, TYPE_DINT));
    munit_assert_false(value_istype(&sValue, TYPE_INT));
    munit_assert_false(value_istype(&sValue, TYPE_SINT));
    munit_assert_false(value_istype(&sValue, TYPE_ULINT));
    munit_assert_false(value_istype(&sValue, TYPE_UDINT));
    munit_assert_false(value_istype(&sValue, TYPE_UINT));
    munit_assert_false(value_istype(&sValue, TYPE_USINT));
    munit_assert_false(value_istype(&sValue, ANY_BIT));
    munit_assert_false(value_istype(&sValue, TYPE_LWORD));
    munit_assert_false(value_istype(&sValue, TYPE_DWORD));
    munit_assert_false(value_istype(&sValue, TYPE_WORD));
    munit_assert_false(value_istype(&sValue, TYPE_BYTE));
    munit_assert_false(value_istype(&sValue, TYPE_BOOL));
    munit_assert_true(value_istype(&sValue, TYPE_TIME));
    munit_assert_false(value_istype(&sValue, TYPE_DATE));
    munit_assert_false(value_istype(&sValue, TYPE_DT));
    munit_assert_false(value_istype(&sValue, TYPE_TOD));
    munit_assert_false(value_istype(&sValue, ANY_STRING));
    munit_assert_false(value_istype(&sValue, TYPE_STRING));
    munit_assert_false(value_istype(&sValue, TYPE_WSTRING));
    value_destroy(&sValue);

    return MUNIT_OK;
}


