Files
bacnet_stack/test/bacnet/basic/object/bv/src/main.c
T
Steve Karg 76d3680b5e Feature - added create/delete/COV services for analog, binary, and multistate objects (#612)
* Added Create/Delete object services to Analog Input, Analog Value, Binary Input, Binary Value, Multistate Input, Multistate Value object examples, and updated their units tests.
2024-04-03 13:27:03 -05:00

68 lines
1.5 KiB
C

/*
* Copyright (c) 2020 Legrand North America, LLC.
*
* SPDX-License-Identifier: MIT
*/
/* @file
* @brief test BACnet integer encode/decode APIs
*/
#include <zephyr/ztest.h>
#include <bacnet/bactext.h>
#include <bacnet/basic/object/bv.h>
#include <property_test.h>
/**
* @addtogroup bacnet_tests
* @{
*/
/**
* @brief Test
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST(bv_tests, testBinary_Value)
#else
static void testBinary_Value(void)
#endif
{
bool status = false;
unsigned count = 0;
uint32_t object_instance = BACNET_MAX_INSTANCE, test_object_instance = 0;
const int skip_fail_property_list[] = { -1 };
Binary_Value_Init();
object_instance = Binary_Value_Create(object_instance);
count = Binary_Value_Count();
zassert_true(count == 1, NULL);
test_object_instance = Binary_Value_Index_To_Instance(0);
zassert_equal(object_instance, test_object_instance, NULL);
bacnet_object_properties_read_write_test(
OBJECT_BINARY_VALUE,
object_instance,
Binary_Value_Property_Lists,
Binary_Value_Read_Property,
Binary_Value_Write_Property,
skip_fail_property_list);
status = Binary_Value_Delete(object_instance);
zassert_true(status, NULL);
}
/**
* @}
*/
#if defined(CONFIG_ZTEST_NEW_API)
ZTEST_SUITE(bv_tests, NULL, NULL, NULL, NULL, NULL);
#else
void test_main(void)
{
ztest_test_suite(bv_tests,
ztest_unit_test(testBinary_Value)
);
ztest_run_test_suite(bv_tests);
}
#endif