Skip to content

Commit

Permalink
Fix expected test results for negative int4 and int2 FIDs
Browse files Browse the repository at this point in the history
int8 negative identifier is still not handled correctly
  • Loading branch information
strk committed Jun 9, 2016
1 parent 9a96414 commit 8bd6ffc
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tests/src/python/test_provider_postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,13 @@ def test_query_attribute(dbconn, query, att, val, fidval):
for f in features:
count += 1
self.assertEqual(f.attributes()[att_idx], val)
#self.assertEqual(f.id(), val)
self.assertEqual(f.id(), fidval)
self.assertEqual(count, 1)
test_query_attribute(self.dbconn, '(SELECT -1::int4 i, NULL::geometry(Point) g)', 'i', -1, 4294967295)
test_query_attribute(self.dbconn, '(SELECT -1::int2 i, NULL::geometry(Point) g)', 'i', -1, 1)
test_query_attribute(self.dbconn, '(SELECT -1::int8 i, NULL::geometry(Point) g)', 'i', -1, 1)
test_query_attribute(self.dbconn, '(SELECT -65535::int8 i, NULL::geometry(Point) g)', 'i', -65535, 1)
test_query_attribute(self.dbconn, '(SELECT -2::int2 i, NULL::geometry(Point) g)', 'i', -2, 4294967294)
# Unfortunately negative int8 identifiers are still not supported at this moment
# TODO: fix expected fidval to be positive !
test_query_attribute(self.dbconn, '(SELECT -3::int8 i, NULL::geometry(Point) g)', 'i', -3, -3)

def testPktIntInsert(self):
vl = QgsVectorLayer('{} table="qgis_test"."{}" key="pk" sql='.format(self.dbconn, 'bikes_view'), "bikes_view", "postgres")
Expand Down

0 comments on commit 8bd6ffc

Please sign in to comment.