Avro
  1. Avro
  2. AVRO-1031

C test case makes too many assumptions of memcmp

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.6.2
    • Fix Version/s: 1.6.3
    • Component/s: c
    • Labels:
      None

      Description

      Philip reported this during the voting for the 1.6.2 release:

      [0]air::tests(276231)$./test_avro_values
      **** Running boolean tests ****
      | 00 .. .. .. .. .. .. .. | .. .. .. .. .. .. .. .. | ................
      | 01 .. .. .. .. .. .. .. | .. .. .. .. .. .. .. .. | ................
      **** Running bytes tests ****
      | 08 DE AD BE EF .. .. .. | .. .. .. .. .. .. .. .. | .^->o...........
      Incorrect sort order
      

        Activity

        Hide
        Douglas Creager added a comment -

        Committed to SVN

        Show
        Douglas Creager added a comment - Committed to SVN
        Hide
        Douglas Creager added a comment -

        Here's a patch. The issue was that avro_value_cmp doesn't necessarily return just -1, 0, or 1. It can return any negative value for “less than”, and any positive value for “greater than”. (This matches what strcmp and memcmp can return.)

        Show
        Douglas Creager added a comment - Here's a patch. The issue was that avro_value_cmp doesn't necessarily return just -1, 0, or 1. It can return any negative value for “less than”, and any positive value for “greater than”. (This matches what strcmp and memcmp can return.)

          People

          • Assignee:
            Douglas Creager
            Reporter:
            Douglas Creager
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development