test: ASHRAE 135 Annex F golden-vector encode tests (+ 3 encoder fixes)#170
Merged
Conversation
ASN1.encode_bacnet_time now emits the wildcard FF FF FF FF for an unspecified time (default DateTime), matching encode_bacnet_date; it previously wrote 00:00:00.00. EncodePrivateTransferAcknowledge no longer NREs on null data and omits the optional [2] result block when there is none. EncodeLogRecord now writes the record status as a context-tagged BACnetStatusFlags bitstring (matching the decode side and ASHRAE F.3.8) instead of a constructed application bitstring. All three fixes mirror #25. Co-Authored-By: Rainer Perl <rainer.perl@sprytech.com>
Harvest the ASHRAE Annex F 'Examples of APDU Encoding' vectors from #25, adapted to the v4 API / xUnit, covering all four sections (F.1 alarm/event, F.2 file access, F.3 object access, F.4 remote device management) - requests, complex-acks and simple-acks. The F.1 alarm/event examples use the flat BacnetEventNotificationData rather than #25's refactored event model. Only the examples needing v4's missing request encoders (CreateObject/DeleteObject, AddListElement's BacnetObjectPropertyReference) are left out. Co-Authored-By: Rainer Perl <rainer.perl@sprytech.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds ASHRAE 135 Annex F "Examples of APDU Encoding" golden-vector encode tests, harvested from #25 (@DarkStarDS9) and adapted to the v4 API. Covers 57 of #25's 62 vectors (92%) across all four Annex F sections — F.1 alarm/event, F.2 file access, F.3 object access, F.4 remote-device management (requests, complex-acks, simple-acks). 115 tests, all green.
The golden vectors also surfaced and fixed three real encoder bugs (first commit):
encode_bacnet_timenow emits the BACnet wildcardFF FF FF FFfor unspecified times (was00:00:00).EncodePrivateTransferAcknowledgeno longer NREs on null data / emits a spurious[2]block.EncodeLogRecordnow context-tags the record status (matching v4's own decoder + the spec; encode/decode were inconsistent).The remaining 5 vectors are blocked by v4's missing request encoders/types (
EncodeCreateObject,EncodeDeleteObject,BacnetObjectPropertyReference) — tracked in #169, to land with the Phase 12 harvest.2 commits (fix + test), co-authored with @DarkStarDS9.