Skip to content
Snippets Groups Projects
  1. Sep 27, 2022
  2. Sep 22, 2022
  3. Sep 20, 2022
  4. Sep 19, 2022
  5. Sep 18, 2022
    • Paolo Bonzini's avatar
      tests: unit: add NULL-pointer check · b3a58a6a
      Paolo Bonzini authored
      
      In CID 1432593, Coverity complains that the result of qdict_crumple()
      might leak if it is not a dictionary.  This is not a practical concern
      since the test would fail immediately with a NULL pointer dereference
      in qdict_size().
      
      However, it is not nice to depend on qdict_size() crashing, so add an
      explicit assertion that that the crumpled object was indeed a dictionary.
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      b3a58a6a
    • Paolo Bonzini's avatar
      tests: test-qga: close socket on failure to connect · 5dc51100
      Paolo Bonzini authored
      
      Reported by Coverity as CID 1432543.
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      5dc51100
    • Paolo Bonzini's avatar
      tests: unit: simplify test-visitor-serialization list tests · ac9e723f
      Paolo Bonzini authored
      
      test-visitor-serialization list tests is using an "if" to pick either the first
      element of the list or the next one.  This was done presumably to mimic the
      code that creates the list, which has to fill in either the head pointer
      or the next pointer of the last element.  However, the code in the insert
      phase is a pretty standard singly-linked list insertion, while the one
      in the visit phase looks weird and even looks at the first item twice:
      this is confusing because the test puts in 32 items and finishes with
      an assertion that i == 33.
      
      So, move the "else" step in a separate switch statement, and change
      the do...while loop to a while, because cur_head has already been
      initialized beforehand.
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      ac9e723f
  6. Sep 02, 2022
  7. Aug 25, 2022
  8. Aug 12, 2022
    • Marc-André Lureau's avatar
      tests/unit: fix a -Wformat-truncation warning · 6a54ac2a
      Marc-André Lureau authored
      
      ../tests/test-qobject-input-visitor.c: In function ‘test_visitor_in_list’:
      ../tests/test-qobject-input-visitor.c:454:49: warning: ‘%d’ directive output may be truncated writing between 1 and 10 bytes into a region of size 6 [-Wformat-truncation=]
        454 |         snprintf(string, sizeof(string), "string%d", i);
            |                                                 ^~
      ../tests/test-qobject-input-visitor.c:454:42: note: directive argument in the range [0, 2147483606]
        454 |         snprintf(string, sizeof(string), "string%d", i);
            |                                          ^~~~~~~~~~
      ../tests/test-qobject-input-visitor.c:454:9: note: ‘snprintf’ output between 8 and 17 bytes into a destination of size 12
        454 |         snprintf(string, sizeof(string), "string%d", i);
            |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      Rather than trying to be clever, since this is called 3 times during
      tests, let's simply use g_strdup_printf().
      
      Signed-off-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-id: 20220810121513.1356081-1-marcandre.lureau@redhat.com
      Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      [PMM: fixed commit message typos]
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      6a54ac2a
  9. Aug 01, 2022
  10. Jul 18, 2022
  11. Jul 12, 2022
  12. Jul 04, 2022
  13. Jun 23, 2022
  14. Jun 22, 2022
  15. Jun 14, 2022
  16. May 28, 2022
  17. May 26, 2022
  18. May 19, 2022
    • Peter Maydell's avatar
      ptimer: Rename PTIMER_POLICY_DEFAULT to PTIMER_POLICY_LEGACY · 9598c1bb
      Peter Maydell authored
      
      The traditional ptimer behaviour includes a collection of weird edge
      case behaviours.  In 2016 we improved the ptimer implementation to
      fix these and generally make the behaviour more flexible, with
      ptimers opting in to the new behaviour by passing an appropriate set
      of policy flags to ptimer_init().  For backwards-compatibility, we
      defined PTIMER_POLICY_DEFAULT (which sets no flags) to give the old
      weird behaviour.
      
      This turns out to be a poor choice of name, because people writing
      new devices which use ptimers are misled into thinking that the
      default is probably a sensible choice of flags, when in fact it is
      almost always not what you want.  Rename PTIMER_POLICY_DEFAULT to
      PTIMER_POLICY_LEGACY and beef up the comment to more clearly say that
      new devices should not be using it.
      
      The code-change part of this commit was produced by
        sed -i -e 's/PTIMER_POLICY_DEFAULT/PTIMER_POLICY_LEGACY/g' $(git grep -l PTIMER_POLICY_DEFAULT)
      with the exception of a test name string change in
      tests/unit/ptimer-test.c which was added manually.
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarFrancisco Iglesias <francisco.iglesias@amd.com>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Message-id: 20220516103058.162280-1-peter.maydell@linaro.org
      9598c1bb
  19. May 16, 2022
Loading