Skip to content

Commit 6b412ba

Browse files
authored
Merge pull request #55 from intersystems/fix-54
fix: defensive coding in ListToBit
2 parents f58ef2e + a157b91 commit 6b412ba

File tree

5 files changed

+23
-3
lines changed

5 files changed

+23
-3
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ jobs:
7777
# all tests passed.
7878
fail: false
7979
- name: Attach the report
80-
uses: actions/upload-artifact@v1
80+
uses: actions/upload-artifact@v4
8181
if: always()
8282
with:
8383
name: ${{ steps.xunit-viewer.outputs.report-name }}

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [4.0.4] - Unreleased
9+
10+
### Fixed
11+
- #54: Defend against possible configuration-dependent SQL exceptions in mapping INT to MAC/CLS coverage
12+
813
## [4.0.3] - 2024-08-19
914

1015
### Fixed

cls/TestCoverage/Procedures.cls

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ ClassMethod ListToBit(pSource As %List) As %Binary [ SqlName = LIST_TO_BIT, SqlP
8282
Set tResult = ""
8383
Set tPointer = 0
8484
While $ListNext(pSource,tPointer,tBitPosition) {
85-
Set $Bit(tResult,tBitPosition) = 1
85+
If $Data(tBitPosition)#2 && (+tBitPosition > 0) {
86+
Set $Bit(tResult,+tBitPosition) = 1
87+
}
8688
}
8789
Quit tResult
8890
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Class UnitTest.TestCoverage.Unit.Procedures Extends %UnitTest.TestCase
2+
{
3+
4+
Method TestListToBit()
5+
{
6+
Set compare = ""
7+
For i=1:1:3 {
8+
Set $Bit(compare,i) = 1
9+
}
10+
Do $$$AssertEquals(##class(TestCoverage.Procedures).ListToBit($lb(1,2,3,,"")),compare)
11+
}
12+
13+
}

module.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Export generator="Cache" version="25">
33
<Document name="TestCoverage.ZPM"><Module>
44
<Name>TestCoverage</Name>
5-
<Version>4.0.3</Version>
5+
<Version>4.0.4</Version>
66
<Description>Run your typical ObjectScript %UnitTest tests and see which lines of your code are executed. Includes Cobertura-style reporting for use in continuous integration tools.</Description>
77
<Packaging>module</Packaging>
88
<Resource Name="TestCoverage.PKG" Directory="cls" />

0 commit comments

Comments
 (0)