Skip to content

Commit

Permalink
Update policy test files according to new conditions to parse CMap
Browse files Browse the repository at this point in the history
  • Loading branch information
georgetarazevich committed Feb 9, 2024
1 parent 2307dbe commit b74fccc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 35 deletions.
21 changes: 6 additions & 15 deletions PDF_A-1b/756/veraPDF test suite 6-1-12-t10-fail-a.sch
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,17 @@
</sch:rule>

<sch:rule context="/report/jobs/job/validationReport/details/rule">
<sch:assert test="(@clause = '6.3.5' and @testNumber = '1' and @failedChecks = '1') or
(@clause = '6.1.12' and @testNumber = '10' and @failedChecks = '1')">Failed rules, Expected:
6.3.5-1, 1 check, or
6.1.12-10, 1 check</sch:assert>
<sch:assert test="(@clause = '6.1.12' and @testNumber = '10' and @failedChecks = '1') or
(@clause = '6.3.5' and @testNumber = '1' and @failedChecks = '1')">Failed rules, Expected:
6.1.12-10, 1 check, or
6.3.5-1, 1 check</sch:assert>
</sch:rule>

</sch:pattern>

<sch:pattern name = "Checking the logs">
<sch:pattern name = "Checking for the absence of logs">
<sch:rule context="/report/jobs/job">
<sch:assert test="count(logs) = 1">Failed check, Expected: contains logs</sch:assert>
</sch:rule>

<sch:rule context="/report/jobs/job/logs">
<sch:assert test="@logsCount = '1'">Failed check, Expected: 1</sch:assert>
</sch:rule>

<sch:rule context="/report/jobs/job/logs/logMessage">
<sch:assert test='(contains(., "Can&apos;t parse CMap Adabe-Karea1-UCS2, using default") and @occurrences = "1" and @level = "WARNING")'>Invalid logs, Expected:
'WARNING: Can't parse CMap Adabe-Karea1-UCS2, using default' with 1 occurrences</sch:assert>
<sch:assert test="not(logs)">Failed check, Expected: no logs</sch:assert>
</sch:rule>
</sch:pattern>

Expand Down
21 changes: 5 additions & 16 deletions PDF_A-1b/875/6.3.3.1-fail-4.sch
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,17 @@
</sch:rule>

<sch:rule context="/report/jobs/job/validationReport/details/rule">
<sch:assert test="(@clause = '6.3.3.1' and @testNumber = '1' and @failedChecks = '1') or
(@clause = '6.3.3.3' and @testNumber = '1' and @failedChecks = '1')">Failed rules, Expected:
6.3.3.1-1, 1 check, or
<sch:assert test="(@clause = '6.3.3.1' and @testNumber = '1' and @failedChecks = '1') or
(@clause = '6.3.3.3' and @testNumber = '1' and @failedChecks = '1')">Failed rules, Expected:
6.3.3.1-1, 1 check, or
6.3.3.3-1, 1 check</sch:assert>
</sch:rule>

</sch:pattern>

<sch:pattern name = "Checking the logs">
<sch:pattern name = "Checking for the absence of logs">
<sch:rule context="/report/jobs/job">
<sch:assert test="count(logs) = 1">Failed check, Expected: contains logs</sch:assert>
</sch:rule>

<sch:rule context="/report/jobs/job/logs">
<sch:assert test="@logsCount = '2'">Failed check, Expected: 2</sch:assert>
</sch:rule>

<sch:rule context="/report/jobs/job/logs/logMessage">
<sch:assert test='(contains(., "Can&apos;t parse CMap WinAnsiEncoding, using default") and @occurrences = "1" and @level = "WARNING") or
(contains(., "Can&apos;t parse CMap null-null-UCS2, using default") and @occurrences = "1" and @level = "WARNING")'>Invalid logs, Expected:
'WARNING: Can't parse CMap WinAnsiEncoding, using default' with 1 occurrences, or
'WARNING: Can't parse CMap null-null-UCS2, using default' with 1 occurrences</sch:assert>
<sch:assert test="not(logs)">Failed check, Expected: no logs</sch:assert>
</sch:rule>
</sch:pattern>

Expand Down
6 changes: 2 additions & 4 deletions PDF_A-2a/837/CMap-fail-2.sch
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,11 @@
</sch:rule>

<sch:rule context="/report/jobs/job/logs">
<sch:assert test="@logsCount = '2'">Failed check, Expected: 2</sch:assert>
<sch:assert test="@logsCount = '1'">Failed check, Expected: 1</sch:assert>
</sch:rule>

<sch:rule context="/report/jobs/job/logs/logMessage">
<sch:assert test='(contains(., "Can&apos;t parse CMap foo, using default") and @occurrences = "1" and @level = "WARNING") or
(contains(., "Incorrect bfrange in toUnicode CMap: the last byte of the string incremented past 255.") and @occurrences = "1" and @level = "WARNING")'>Invalid logs, Expected:
'WARNING: Can't parse CMap foo, using default' with 1 occurrences, or
<sch:assert test='(contains(., "Incorrect bfrange in toUnicode CMap: the last byte of the string incremented past 255.") and @occurrences = "1" and @level = "WARNING")'>Invalid logs, Expected:
'WARNING: Incorrect bfrange in toUnicode CMap: the last byte of the string incremented past 255.' with 1 occurrences</sch:assert>
</sch:rule>
</sch:pattern>
Expand Down

0 comments on commit b74fccc

Please sign in to comment.