Commit Graph

15 Commits

Author SHA1 Message Date
Kari Argillander 369da70f2a Strip tabs and trailing white spaces, and fix end of files (#748)
* format: Strip trailing whitespaces

We want to get rid of trailing whitespaces completly as they make just git
noice. Much better to start using automated tools to get rid of them once and
not getting them back again. This way git history will be cleaner and review
easier.

Commit was generated with:

    pre-commit run --all-files trailing-whitespace

* format: Files should have exactly one new line end of them

It is good practice that every file has one new line. It is not now days so
mandatory but it also is not nice if file has lot of newlines end of it. We will
use pre-commit which takes automatically care about this so let's fix all.

Commit was generated with:

    pre-commit run --all-files end-of-file-fixer

* format: Convert tabs to spaces

Project mostly use spaces over tabs. When mixing tabs and spaces this usually
makes formatting issues and also when changing those in commits it will make lot
of git noise. We will force spaces most of the time and use pre-commit to fix.

Commit was generated with:

    pre-commit run --all-files remove-tabs

---------

Co-authored-by: Kari Argillander <kari.argillander@fidelix.com>
2024-08-25 14:13:57 -05:00
Steve Karg ebb8be067f Removed extraenous coverage recipe in test all recipe. 2024-08-07 11:44:15 -05:00
Steve Karg b5e0aa97fc revert LCOV changes to test Makefile 2024-08-06 16:30:56 -05:00
Steve Karg be65abe159 Fixed unit test compiler warnings 2024-08-06 16:19:08 -05:00
Steve Karg f641aacddb Bugfix/deprecate decode tag number and value (#481)
* added or updated secure the BACnet primitive value decoders - the core codecs - named bacnet_x_decode(), bacnet_x_application_decode() and bacnet_x_context_decode where x is one of the 13 BACnet primitive value names.  The updated API includes an APDU size to prevent over-reading of an APDU buffer while decoding.  Improved or added unit test code coverage for the BACnet primitive value decoders.

* marked the insecure decoding API as 'deprecated' which is defined in src/bacnet/basic/sys/platform.h and can be disabled during a build. 

* added secure decoders for BACnetTimeValue, BACnetHostNPort, BACnetTimeStamp, BACnetAddress, and Weekly_Schedule and improved unit test code coverage.

* improved test code coverage for BACnet objects and properties.

* secured AtomicReadFile and AtomicWriteFile service decoders and improved unit test code coverage.

* secured BACnet Error service decoder and improved unit test code coverage.

---------

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-09-08 11:39:27 -05:00
Steve Karg 8184afea12 Chore/make test parallel build limits (#480)
* re-enable parallel build for CMake unit tests, but limited to ncores on supported OSes. Using MAKEFLAGS in .bashrc to set the '-j' flag size causes problem for Makefile build of BACnet library which doesn't tolerate parallel builds.  Using "-j" without limits for CMake of unit tests overwhelms my lesser endowed build machines.

---------

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-08-25 15:15:32 -05:00
Steve Karg 77b2881f60 fix analog, binary, and multistate output tests 2022-11-10 17:35:03 -06:00
Steve Karg e08680044e Added FD BBMD Address encoding. (#269)
* Added FD BBMD Address encoder and decoder

* Added FD BBMD address to bacapp

* Added FD BBMD address to network port object

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2022-05-10 17:06:51 -05: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
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 8d109a51ba Encapsulate unit test Makefile for CI 2019-10-09 08:11:06 -05:00