Uploaded image for project: 'Geode'
  1. Geode
  2. GEODE-8580

Improper use of throw in new C++ test framework

    XMLWordPrintableJSON

Details

    Description

      The new C++ test framework (cppcache/integration/framework) throws pointers to exceptions. This is never a good idea. https://stackoverflow.com/questions/10948316/throw-new-stdexception-vs-throw-stdexception

      Although you can catch pointers, it's not recommended practice.

      Note: The particular error I ran into was in GfshExecute::execute, where

           throw new GfshExecuteException("gfsh error", exit_code);

      was being used. This requires gtest to use: 

           EXPECT_THROW(gfsh.query(query_stmt).execute(), GfshExecuteException*);

      Attachments

        Issue Links

          Activity

            People

              mmartell Michael Martell
              mmartell Michael Martell
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: