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

test utility error handling.

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Minor - P4
    • Resolution: Fixed
    • None
    • WT2.8.0
    • None
    • None

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: