Changeset 1383

Show
Ignore:
Timestamp:
08/19/08 01:21:01 (5 months ago)
Author:
jtv
Message:

More test build failures that some gcc don't complain about.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/test/unit/test_sql_cursor.cxx

    r1382 r1383  
    4040  PQXX_CHECK_EQUAL(row.size(), 0u, "fetch(0, displacement) returns rows"); 
    4141  PQXX_CHECK_EQUAL(displacement, 0, "Unexpected displacement after fetch(0)"); 
    42   PQXX_CHECK_EQUAL(forward.pos(), 2u, "fetch(0, displacement) affected pos()"); 
     42  PQXX_CHECK_EQUAL(forward.pos(), 2, "fetch(0, displacement) affected pos()"); 
    4343 
    4444  row = forward.fetch(0); 
    4545  PQXX_CHECK_EQUAL(row.size(), 0u, "fetch(0) fetched wrong number of rows"); 
    46   PQXX_CHECK_EQUAL(forward.pos(), 2u, "fetch(0) moved cursor"); 
    47   PQXX_CHECK_EQUAL(forward.pos(), 2u, "fetch(0) affected pos()"); 
     46  PQXX_CHECK_EQUAL(forward.pos(), 2, "fetch(0) moved cursor"); 
     47  PQXX_CHECK_EQUAL(forward.pos(), 2, "fetch(0) affected pos()"); 
    4848 
    4949  offset = forward.move(1); 
     
    5353  row = forward.fetch(1); 
    5454  PQXX_CHECK_EQUAL(row.size(), 1u, "fetch(1) returned wrong number of rows"); 
    55   PQXX_CHECK_EQUAL(forward.pos(), 4u, "fetch(1) results in bad pos()"); 
     55  PQXX_CHECK_EQUAL(forward.pos(), 4, "fetch(1) results in bad pos()"); 
    5656  PQXX_CHECK_EQUAL(row[0][0].as<string>(), "4", "pos() is lying"); 
    5757 
    5858  empty_result = forward.fetch(1, displacement); 
    5959  PQXX_CHECK_EQUAL(empty_result.size(), 0u, "Got rows at end of cursor"); 
    60   PQXX_CHECK_EQUAL(forward.pos(), 5u, "Not at one-past-end position"); 
     60  PQXX_CHECK_EQUAL(forward.pos(), 5, "Not at one-past-end position"); 
    6161  PQXX_CHECK_EQUAL(forward.endpos(), 5, "Failed to notice end position"); 
    6262  PQXX_CHECK_EQUAL(displacement, 1, "Wrong displacement at end position"); 
     
    6464  offset = forward.move(5, displacement); 
    6565  PQXX_CHECK_EQUAL(offset, 0, "move() lied at end of result set"); 
    66   PQXX_CHECK_EQUAL(forward.pos(), 5u, "pos() is beyond end"); 
     66  PQXX_CHECK_EQUAL(forward.pos(), 5, "pos() is beyond end"); 
    6767  PQXX_CHECK_EQUAL(forward.endpos(), 5, "endpos() changed after end position"); 
    6868  PQXX_CHECK_EQUAL(displacement, 0, "Wrong displacement after end position"); 
     
    9898  PQXX_CHECK_EQUAL(rows.size(), 4u, "Unexpected number of rows in result set"); 
    9999  PQXX_CHECK_EQUAL(displacement, 5, "displacement != rows+1"); 
    100   PQXX_CHECK_EQUAL(forward3.pos(), 5u, "Bad pos() after fetching all rows"); 
     100  PQXX_CHECK_EQUAL(forward3.pos(), 5, "Bad pos() after fetching all rows"); 
    101101  PQXX_CHECK_EQUAL(forward3.endpos(), 5, "Bad endpos() after fetching"); 
    102102 
     
    111111 
    112112  offset = forward_empty.move(3, displacement); 
    113   PQXX_CHECK_EQUAL(forward_empty.pos(), 1u, "Bad pos() at end of result"); 
     113  PQXX_CHECK_EQUAL(forward_empty.pos(), 1, "Bad pos() at end of result"); 
    114114  PQXX_CHECK_EQUAL(forward_empty.endpos(), 1, "Bad endpos() in empty result"); 
    115115  PQXX_CHECK_EQUAL(displacement, 1, "Bad displacement in empty result"); 
     
    128128        false); 
    129129 
    130   PQXX_CHECK_EQUAL(scroll.pos(), 0u, "Scroll cursor's initial pos() is wrong"); 
     130  PQXX_CHECK_EQUAL(scroll.pos(), 0, "Scroll cursor's initial pos() is wrong"); 
    131131  PQXX_CHECK_EQUAL(scroll.endpos(), -1, "New scroll cursor has endpos() set"); 
    132132 
    133133  result rows = scroll.fetch(cursor_base::next()); 
    134134  PQXX_CHECK_EQUAL(rows.size(), 1u, "Scroll cursor is broken"); 
    135   PQXX_CHECK_EQUAL(scroll.pos(), 1u, "Scroll cursor's pos() is broken"); 
     135  PQXX_CHECK_EQUAL(scroll.pos(), 1, "Scroll cursor's pos() is broken"); 
    136136  PQXX_CHECK_EQUAL(scroll.endpos(), -1, "endpos() set prematurely"); 
    137137 
     
    141141  rows = scroll.fetch(cursor_base::prior()); 
    142142  PQXX_CHECK_EQUAL(rows.empty(), true, "Turning around on fetch() broke"); 
    143   PQXX_CHECK_EQUAL(scroll.pos(), 0u, "pos() is not back at zero"); 
     143  PQXX_CHECK_EQUAL(scroll.pos(), 0, "pos() is not back at zero"); 
    144144  PQXX_CHECK_EQUAL(scroll.endpos(), -1, "endpos() set on wrong side of result"); 
    145145 
     
    150150  PQXX_CHECK_EQUAL(offset, 0, "Rows found before beginning"); 
    151151  PQXX_CHECK_EQUAL(displacement, 0, "Failed to bounce off beginning"); 
    152   PQXX_CHECK_EQUAL(scroll.pos(), 0u, "pos() moved back from zero"); 
     152  PQXX_CHECK_EQUAL(scroll.pos(), 0, "pos() moved back from zero"); 
    153153  PQXX_CHECK_EQUAL(scroll.endpos(), -1, "endpos() set on left-side bounce"); 
    154154 
     
    158158  PQXX_CHECK_EQUAL(offset, 4, "Offset mismatch"); 
    159159  PQXX_CHECK_EQUAL(displacement, 4, "Displacement mismatch"); 
    160   PQXX_CHECK_EQUAL(scroll.pos(), 4u, "Position mismatch"); 
     160  PQXX_CHECK_EQUAL(scroll.pos(), 4, "Position mismatch"); 
    161161  PQXX_CHECK_EQUAL(scroll.endpos(), -1, "endpos() set at weird time"); 
    162162 
     
    164164  PQXX_CHECK_EQUAL(offset, 3, "Offset mismatch"); 
    165165  PQXX_CHECK_EQUAL(displacement, -4, "Displacement mismatch"); 
    166   PQXX_CHECK_EQUAL(scroll.pos(), 0u, "Hard bounce failed"); 
     166  PQXX_CHECK_EQUAL(scroll.pos(), 0, "Hard bounce failed"); 
    167167  PQXX_CHECK_EQUAL(scroll.endpos(), -1, "endpos() set during hard bounce"); 
    168168 
    169169  rows = scroll.fetch(3); 
    170   PQXX_CHECK_EQUAL(scroll.pos(), 3u, "Bad pos()"); 
     170  PQXX_CHECK_EQUAL(scroll.pos(), 3, "Bad pos()"); 
    171171  PQXX_CHECK_EQUAL(rows.size(), 3u, "Wrong number of rows"); 
    172172  PQXX_CHECK_EQUAL(rows[2][0].as<int>(), 3, "pos() does not match data"); 
    173173  rows = scroll.fetch(-1); 
    174   PQXX_CHECK_EQUAL(scroll.pos(), 2u, "Bad pos()"); 
     174  PQXX_CHECK_EQUAL(scroll.pos(), 2, "Bad pos()"); 
    175175  PQXX_CHECK_EQUAL(rows[0][0].as<int>(), 2, "pos() does not match data"); 
    176176 
    177177  rows = scroll.fetch(1); 
    178   PQXX_CHECK_EQUAL(scroll.pos(), 3u, "Bad pos() after inverse turnaround"); 
     178  PQXX_CHECK_EQUAL(scroll.pos(), 3, "Bad pos() after inverse turnaround"); 
    179179  PQXX_CHECK_EQUAL(rows[0][0].as<int>(), 3, "Data position mismatch"); 
    180180} 
     
    203203  PQXX_CHECK_EQUAL(rows[2][0].as<int>(), 1, "Wrong result data"); 
    204204  PQXX_CHECK_EQUAL(displacement, -4, "Wrong displacement"); 
    205   PQXX_CHECK_EQUAL(adopted.pos(), 0u, "Failed to recognize starting position"); 
     205  PQXX_CHECK_EQUAL(adopted.pos(), 0, "Failed to recognize starting position"); 
    206206  PQXX_CHECK_EQUAL(adopted.endpos(), -1, "endpos() set too early"); 
    207207 
    208208  cursor_base::difference_type offset = adopted.move(cursor_base::all()); 
    209209  PQXX_CHECK_EQUAL(offset, 3, "Unexpected move() offset"); 
    210   PQXX_CHECK_EQUAL(adopted.pos(), 4u, "Bad position on adopted cursor"); 
     210  PQXX_CHECK_EQUAL(adopted.pos(), 4, "Bad position on adopted cursor"); 
    211211  PQXX_CHECK_EQUAL(adopted.endpos(), 4, "endpos() not set properly"); 
    212212