Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-2405

test utility error handling.

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • WT2.8.0
    • Affects Version/s: None
    • Component/s: None
    • None

      alexander.gorrod, david.hows, we have a lot of simple error handling code in the test programs, and it looks like we're adding new test programs at a fast rate.

      What would you think about a general-purpose macro that makes simple error handling in the test programs easier?

      Something like this:

      /*
       * check --
       *      Complain and quit if a function call fails.
       */
      #define check(call) do {                                                \
              int __r;                                                        \
              if ((__r = (call)) != 0)                                        \
                      die(__r, "%s/%d: %s", __func__, __LINE__, #call);       \
      } while (0)
      

      I'll push a branch to show you what it ends up looking like, using format as an example.

            Assignee:
            keith.bostic@mongodb.com Keith Bostic (Inactive)
            Reporter:
            keith.bostic@mongodb.com Keith Bostic (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: