Skip to content

Commit

Permalink
Add new test - Parsing inline images #1335
Browse files Browse the repository at this point in the history
  • Loading branch information
georgetarazevich committed Sep 28, 2023
1 parent 33b8246 commit 5ef304f
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 0 deletions.
Binary file added PDF_A-3a/1335/Q_operator_Undefined.pdf
Binary file not shown.
37 changes: 37 additions & 0 deletions PDF_A-3a/1335/Q_operator_Undefined.sch
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://purl.oclc.org/dsdl/schematron ">

<!-- Issue# 1335 -->
<!-- https://github.com/veraPDF/veraPDF-library/issues/1335 -->
<!-- File: Q_operator_Undefined.pdf -->


<sch:pattern name = "Checking the validationReport: document is not compliant">
<sch:rule context="/report/jobs/job/validationReport">
<sch:assert test="(@isCompliant = 'false')">Failed check, Expected: isCompliant=false</sch:assert>
</sch:rule>
</sch:pattern>

<sch:pattern name = "Checking the validationReport: rules">
<sch:rule context="/report/jobs/job/validationReport/details">
<sch:assert test="(@failedRules = '2')">Failed check, Expected: 2</sch:assert>
</sch:rule>

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

</sch:pattern>

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

</sch:schema>
Binary file added PDF_A-3a/1335/pdfa_2TextAndImage_English.pdf
Binary file not shown.
31 changes: 31 additions & 0 deletions PDF_A-3a/1335/pdfa_2TextAndImage_English.sch
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://purl.oclc.org/dsdl/schematron ">

<!-- Issue# 1335 -->
<!-- https://github.com/veraPDF/veraPDF-library/issues/1335 -->
<!-- File: pdfa_2TextAndImage_English.pdf -->

<sch:pattern name = "Checking the validationReport: profile">
<sch:rule context="/report/jobs/job/validationReport">
<sch:assert test="(@isCompliant = 'true')">Failed check, Expected: isCompliant=true</sch:assert>
</sch:rule>
</sch:pattern>

<sch:pattern name = "Checking the 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(., "Inline image content contains EI inside") and @occurrences = "1" and @level = "WARNING")'>Invalid logs, Expected:
'WARNING: Inline image content contains EI inside' with 1 occurrences</sch:assert>
</sch:rule>
</sch:pattern>

</sch:schema>

0 comments on commit 5ef304f

Please sign in to comment.