Opened 14 years ago

Closed 14 years ago

#3341 closed defect (fixed)

osr_xml test flawed

Reported by: warmerdam Owned by: chaitanya
Priority: normal Milestone:
Component: default Version: unspecified
Severity: normal Keywords: osr_xml
Cc:

Description

In a build of GDAL with the JP2KAK driver, a full run of the autotest fails in osr_xml. This is because previous tests (jp2kak presumably) also does xml encoding and the xml encoder uses a process life long counter to allocate new unique gml:id's for components of the srs. So we get a failure where the first gml:id is ogrcrs13 instead of ogrcrs1 as expected.

The problem can also be reproduced by just copying osr/osr_xml.py to osr/osr_xml2.py and reruning just the osr series (run_test.py osr).

I imagine the osr_xml.py test will need to make a pass through the XML stripping out the values of the gml:id's to avoid unnecessary test failures based on different ids being produced.

Attachments (1)

ticket_3341.patch (6.4 KB ) - added by Even Rouault 14 years ago.
Remove use of static variable

Download all attachments as: .zip

Change History (5)

comment:1 by Even Rouault, 14 years ago

Summary: osr_xml test flawed[PATCH] osr_xml test flawed

Frank,

Wouldn't it be better and simpler to avoid the static variable in ogr_srs_xml.cpp instead ? That's the purpose of the attached patch. The only thing that prevents me to commit it right now is that I'm not sure what the expected extent of the unicity of the gmlid is (haven't read the OGC XML spec...) . If it must only be unique in the context of the elements generated by a call to exportToXML(), then my patch should do it.

by Even Rouault, 14 years ago

Attachment: ticket_3341.patch added

Remove use of static variable

comment:2 by warmerdam, 14 years ago

Even, the uniqueness must at the very least extend over one complete XML document, and the exportToXML() is expected to produce only a fragment of a document. There are cases, particularly the production of coordinate system dictionaries, in which one GML document might include several coordinate systems.

So I don't think removing the static variable is an appropriate solution.

comment:3 by Even Rouault, 14 years ago

Summary: [PATCH] osr_xml test flawedosr_xml test flawed

Chaintanya,

you can forget the patch and follow Frank's initial suggestion

comment:4 by chaitanya, 14 years ago

Resolution: fixed
Status: newclosed

Modified the test in trunk (r20245).

Note: See TracTickets for help on using tickets.