Commit Graph

280 Commits

Author SHA1 Message Date
Mikhail Antropov c5304699bc Fix datalink/mock test for non-unit_testing board 2022-04-21 17:08:12 +03:00
Mikhail Antropov c85eeba2da Fix code review.
Added datalink_receive test using ports/rx62n/bacnet.c as an example.
2022-04-21 16:34:38 +03:00
Mikhail Antropov 183938cac7 Add test datalink using mock functions 2022-04-20 11:38:58 +03:00
Mikhail Antropov 584003bb0a Extend Zephyr tests for the unit_testing board
Fix tests: basic/object/ai, basic/object/av, basic/object/access_credential
2022-04-20 11:35:57 +03:00
Steve Karg ffe9697dc0 Added unit test for GetAlarmSummary service (#237)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2022-03-05 21:45:38 -06:00
Steve Karg c3a4c229fe Issue 87 execute tests with GitHub ci (#234)
* Enable lcov coverage in unit testing via cmake.

* fix pipeline build error

* add compile options for unit test to silence some warnings

* remove all BAC_TEST unit tests in src/bacnet/ folder. They are now in test/bacnet/ folders using ztest.

* removed key.c - only used for unit test.

* produce XML test result output for parsing

* produce junit XML test result output

* change lint workflow to quality

* update readme badge for quality results

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2022-02-28 20:09:46 -06:00
Greg Shue 8b8ef8f338 Issue 187 enable skipped ztest suites (#189)
* Fix some ztests that were skipped

* Expose bacapp_same_value()

* Fix bacapp, ptransfer tests

* Fix bugs in Load_Control object & tests

* refactor days functions from datetime module

* fix legacy ctests

* Add bacnet/basic/sys/days.[ch] to Zephyr build

* Update ztest to match from Zephyr v2.6.0; update ringbuf, datetime to build

* Fixup ztest test for object/acc

* Fix bvlc_address_from_ascii; enable/fix bvlc test

* Comment cleanup

* test/bacnet/basic/object/lc partially enabled

* Fix bacapp_decode_data_len return status on erroneous input

* fix ztest include fatal error

* fix ztest strsignal reference fatal error

* fix zassert_mem_equal reference syntax error

* fix zassert_mem_equal reference syntax error

Co-authored-by: Gregory Shue <gregory.shue@legrand.us>
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2021-08-16 17:29:40 -05:00
Steve Karg 541f4024fb Bugfix/network port object bdt required (#184)
* Added BDT encoding to network port object.

* Added BDT encoding rules from clause 21

* Added FDT encoding to network port object.

* added more unit tests for BVLC

* Fix network port and device object unit tests

* fix router build for bvlc dependencies

* fix router build for bvlc dependencies

* fix network port MSTP compile

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
Co-authored-by: Steve Karg <steve.karg@legrand.us>
2021-08-03 09:55:01 -05:00
Steve Karg 4b9e154256 Feature/mstp extended frames cobs encoding (#183)
* added COBS encode and decode from BACnet standard

* Add unit tests for COBS encoding and decoding

* Improve COBS unit test and API.

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2021-07-30 16:16:12 -05:00
Steve Karg 810a2f93de Feature/write property type check refactor (#182)
* refactor write-property tag check

* modify ports objects to use write-property tag check API

* modify example objects to use write-property tag check API

* Fix object unit test builds

* Fix and run unit ztests via CMake

* Enable unit testing on Travis CI

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2021-06-23 10:10:12 -05:00
Steve Karg 3e9807327b Added characterstring change of value example (#175)
* Added characterstring change of value example

* Add COV to unit tests

* Add memcopy to object COV unit tests

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2021-05-24 20:15:03 -05:00
Steve Karg 038ba9ec2b Feature/access event notification (#156)
* Added event notification for access event. Thank you, Ojdanic Andrijana!

* Added event notification for command failure. Thank you, Ojdanic Andrijana!

* Fix event notification ztest

* Fix event notification ztest

* Added ztest for command failure and access event

* fix zassert_equal test function args

* fix zassert_equal test function args

* fix zassert_true test function args.

Fix verifyBaseEventState().

* Fix octetstring_value_same to use zassert_true

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2021-02-22 13:23:48 -06:00
Greg Shue c5f59af14b Zephyr cleanup (fix date-time.c, cleanout device.c, use full C lib) (#124)
Co-authored-by: Gregory Shue <gregory.shue@legrand.us>
2020-09-23 14:27:52 -05:00
Greg Shue a95b7d597e Zephyr core bacnet server port; bacnet/device test (#123)
Co-authored-by: Gregory Shue <gregory.shue@legrand.us>
2020-09-22 09:24:38 -05:00
Greg Shue 5c2f198fd8 Issue 121 zephyr module cleanup west 0 8 0a1 (#122)
* Rm top-level west.yml; Cleanup manifests; Fix unit testing

* Cleanup sample

* Cleanup test CMakeLists

Co-authored-by: Gregory Shue <gregory.shue@legrand.us>
2020-09-17 09:58:06 -05:00
Greg Shue 19869dccdb Feature/zephyr ztest (#118)
* Leverage (older) embedded unit tests into external unit tests build upon copy of Zephyr's ztest library and CMake.

* Expand top-level CMake build to run external unit tests.

* Expand Zephyr module extension to run external unit tests via west or sanitycheck.

Co-authored-by: Gregory Shue <gregory.shue@legrand.us>
2020-09-16 07:33:34 -05:00
Carlos Gomes Martinho 981d4036c8 refactor: rename test macro to prevent collisions (#91)
* refactor: rename test macro to prevent collisions

* style: align cmake epilog

* refactor: rename define in makefiles
2020-05-28 08:55:05 -05:00
Steve Karg cbfa74e48d Bugfix/bacnet real endian simplify (#89)
* Remove dependence on endian define

* Make use of existing big_endian function if BACNET_BIG_ENDIAN is not defined

* Add efficient endian macro option if available

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2020-05-24 09:36:21 -05:00
Steve Karg 3553ae56c2 Fixed objects list helper and unit test (#86)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2020-05-15 15:41:02 -05:00
Steve Karg d7918bb2ea Feature/add bbmd unit tests (#65)
* Added som BBMD IPv4 and IPv6 unit tests

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2020-04-11 22:58:07 -05:00
Steve Karg eedfa58a55 Feature/refactor bacnet ipv4 add unit tests (#64)
* refactor BACnet/IPv4 BVLC into encode-decode library with unit tests
Added Read-Broadcast-Distribution-Table encoding and unit test.
Added Read-Broadcast-Distribution-Table-Ack encoding and unit test.
Added Read-Foreign-Device-Table-Ack encoding and unit test.
Added some BDT/FDT diff copy functions with unit tests
Added some FDT add and delete entry functions with unit tests
Added some BDT set append and clear entry functions with unit tests
Added some BIPv4 address conversion functions with unit tests
Added non-BBMD handling unit test
Added basic unit test for BBMD handler
Added BBMD broadcast mask get set and unit tests
Added IPv6 maintenance timer.
Added ReadFDT app
Fixed ReadBDT app
Added Who-Is to Makefile for individual app build
Fixed debugging code blocks projects by swapping bip.c for h_bbmd.c module.
Ported BACnet/IPv4 to refactored BVLC for Linux, BSD, Windows
Fix datalink debug for DLENV module
Improve BIPv4 linux driver debug info
Added BDT mask functions
Reduce debug info clutter in Who-Is app by using environment option
Fix TTL seconds upper bounds addition
Fix CIDR prefix calculation on Linux BIPv4.
Convert BSD BIPv4 to BVLCv4
Fix CMake build for BIPv4 (Linux, BSD, Windows)
Added [U]nsigned to 0xBAC0 constants
Cleanup POSIX and Win32 API sockets
Remove unnecessary file scope variable initialization
Fix routed NPDU to depend on datalink; fix warning
Remove OS dependent network code from gateway
Enable BBMD client in library by default
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
Co-authored-by: Steve Karg <steve.karg@legrand.us>
2020-04-04 11:31:54 -05:00
Steve Karg 81d3a0b4a4 fix BVLC6 Delete-Foreign-Device-Table-Entry (#56)
* fix BVLC6 Delete-Foreign-Device-Table-Entry

* Add unit test failure detection to Makefile report target

* Fix the IPv6 layers for sending PDU

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2020-03-12 12:24:07 -05:00
Steve Karg 5ed135c441 build: drop old visual studio / code blocks build files (#53)
* build: drop old visual studio build files

* build: also remove code blocks files
2020-03-04 13:30:38 -06:00
Steve Karg 677f528aa4 Added OS detection into tests to add EXE extension to test executables for cleanup. (#46) 2020-02-18 08:22:16 -06:00
Steve Karg f721350b3f Bug #61: add strict decoding for AtomicReadFile, AtomicWriteFile, and DeviceCommunicationControl 2020-01-04 12:06:28 -06:00
Steve Karg 956acac299 removed unmaintainable project files from IDE 2019-12-17 17:24:22 -06:00
Steve Karg d50c190957 Issue 2 move folders and use deep path include file names to prevent collisions (#4)
* moving folders and files and adjust server demo build

* Fix Makefile for apps/server on Linux

* fix unit test source file folders

* fix datetime convert UTC functions. Add Code::Blocks project for datetime testing

* added some ignore extensions

* disable parallel make option

* fix build for abort, dcc, and epics apps

* fix build for dcc, epics, error, and getevent apps.

* Fixed building of all apps

* fix the ipv4 to ipv6 router app build

* Change indent style from Google to Webkit

* make pretty to re-format style

* removed common Makefile since we already had one and two was too many

* remove scripts from root folder that are no longer maintained or used

* remove mercurial EOL and ignore files for git repo

* remove .vscodeconfig files from repo

* tweak clang-format style

* clang-format src and apps with tweaked style

* added clang-tidy to fix readability if braces in src

* result of make tidy for src and apps

* fix clang-tidy mangling

* Added code::blocks project for BACnet server simulation

* added code::blocks linux project for WhoIs app

* update text files for EOL

* fix EOL in some files

* fixed make win32 apps for older gcc

* Removed Borland C++ Makefile in apps. Unable to maintain support for Borland C++ compiler.

* created codeblocks project for apps/epics for Windows

* fixing ports/xplained to work with new data structure.

* fix ports/xplained example for Atmel Studio compile

* fix ports/stm32f10x example for gcc Makefile compile

* fix ports/stm32f10x example for IAR EWARM compile

* fix ports/xplained timer callback

* fix ports/bdk_atxx_mspt build with subdirs

* fix ports/bdk_atxx_mspt build with subdirs

* updated git ignore for IAR build artifacts

* updated gitignore for non-tracked files and folders

* fixed bdk-atxx4-mstp port for Rowley Crossworks project file

* fixed bdk-atxx4-mstp port for GCC AVR Makefile

* fixed atmega168 port for IAR AVR and GCC AVR Makefile

* fixed at91sam7s port for IAR ARM and GCC ARM Makefile

* removed unmaintainable DOS, RTOS32, and atmega8 ports.  Updated rx62n (untested).

* changed arm7 to uip port
2019-12-13 15:19:10 -06:00
Steve Karg f4dac4acb2 adjusting EOL for specific files 2019-10-20 13:46:21 -05:00
Steve Karg 8d109a51ba Encapsulate unit test Makefile for CI 2019-10-09 08:11:06 -05:00
Steve Karg a42e8f507c adjust root folder 2019-10-08 23:47:53 -05:00