artemp/trac2github — Issue #648: duplicate features from shape.input after r2077/r2083
Author: artemp
Created: 2011-10-09 20:45:19+00:00
State: open
Labels: Core_Library

it appears that

{{{
if (!shape_.shp().is_eof())
}}}

reads one past where it should compared to the previous usage of:

{{{
if (pos < std::streampos(file_length_ * 2))
}}}

as I am seeing in the nosetests:

{{{
======================================================================
FAIL: python_tests.datasource_test.test_total_feature_count
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Library/Python/2.6/site-packages/nose-0.11.3-py2.6.egg/nose/case.py", line 186, in runTest
self.test(*self.arg)
File "/Users/dane/projects/mapnik-dev/0.7.2-dev/tests/python_tests/datasource_test.py", line 24, in test_total_feature_count
eq_(num_feats, 10)
File "/Library/Python/2.6/site-packages/nose-0.11.3-py2.6.egg/nose/tools.py", line 31, in eq_
assert a == b, msg or "%r != %r" % (a, b)
AssertionError: 11 != 10

======================================================================
FAIL: python_tests.datasource_test.test_feature_envelope
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Library/Python/2.6/site-packages/nose-0.11.3-py2.6.egg/nose/case.py", line 186, in runTest
self.test(*self.arg)
File "/Users/dane/projects/mapnik-dev/0.7.2-dev/tests/python_tests/datasource_test.py", line 33, in test_feature_envelope
eq_(contains, True)
File "/Library/Python/2.6/site-packages/nose-0.11.3-py2.6.egg/nose/tools.py", line 31, in eq_
assert a == b, msg or "%r != %r" % (a, b)
AssertionError: False != True

----------------------------------------------------------------------
Ran 84 tests in 1.293s
}}}