< prev index next >

test/hotspot/gtest/logging/test_logTagSetDescriptions.cpp

Print this page




   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 #include "precompiled.hpp"

  25 #include "logTestUtils.inline.hpp"
  26 #include "logging/logConfiguration.hpp"
  27 #include "logging/logTagSet.hpp"
  28 #include "logging/logTagSetDescriptions.hpp"
  29 #include "memory/resourceArea.hpp"
  30 #include "prims/jvm.h"
  31 #include "unittest.hpp"
  32 #include "utilities/ostream.hpp"
  33 
  34 TEST_VM(LogTagSetDescriptions, describe) {
  35   for (LogTagSetDescription* d = tagset_descriptions; d->tagset != NULL; d++) {
  36     char expected[1 * K];
  37     d->tagset->label(expected, sizeof(expected), "+");
  38     jio_snprintf(expected + strlen(expected),
  39                  sizeof(expected) - strlen(expected),
  40                  ": %s", d->descr);
  41 
  42     ResourceMark rm;
  43     stringStream stream;
  44     LogConfiguration::describe(&stream);
  45     EXPECT_PRED2(string_contains_substring, stream.as_string(), expected)
  46       << "missing log tag set descriptions in LogConfiguration::describe";
  47   }
  48 }
  49 
  50 TEST_VM(LogTagSetDescriptions, command_line_help) {


   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 #include "precompiled.hpp"
  25 #include "jvm.h"
  26 #include "logTestUtils.inline.hpp"
  27 #include "logging/logConfiguration.hpp"
  28 #include "logging/logTagSet.hpp"
  29 #include "logging/logTagSetDescriptions.hpp"
  30 #include "memory/resourceArea.hpp"

  31 #include "unittest.hpp"
  32 #include "utilities/ostream.hpp"
  33 
  34 TEST_VM(LogTagSetDescriptions, describe) {
  35   for (LogTagSetDescription* d = tagset_descriptions; d->tagset != NULL; d++) {
  36     char expected[1 * K];
  37     d->tagset->label(expected, sizeof(expected), "+");
  38     jio_snprintf(expected + strlen(expected),
  39                  sizeof(expected) - strlen(expected),
  40                  ": %s", d->descr);
  41 
  42     ResourceMark rm;
  43     stringStream stream;
  44     LogConfiguration::describe(&stream);
  45     EXPECT_PRED2(string_contains_substring, stream.as_string(), expected)
  46       << "missing log tag set descriptions in LogConfiguration::describe";
  47   }
  48 }
  49 
  50 TEST_VM(LogTagSetDescriptions, command_line_help) {
< prev index next >