< prev index next >

test/hotspot/gtest/logging/test_logConfiguration.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 "logTestFixture.hpp"
  26 #include "logTestUtils.inline.hpp"
  27 #include "logging/logConfiguration.hpp"
  28 #include "logging/logFileStreamOutput.hpp"
  29 #include "logging/logLevel.hpp"
  30 #include "logging/logOutput.hpp"
  31 #include "logging/logTag.hpp"
  32 #include "logging/logTagSet.hpp"
  33 #include "memory/resourceArea.hpp"
  34 #include "prims/jvm.h"
  35 #include "unittest.hpp"
  36 #include "utilities/ostream.hpp"
  37 
  38 class LogConfigurationTest : public LogTestFixture {
  39  protected:
  40   static char _all_decorators[256];
  41 
  42  public:
  43   static void SetUpTestCase();
  44 };
  45 
  46 char LogConfigurationTest::_all_decorators[256];
  47 
  48 // Prepare _all_decorators to contain the full list of decorators (comma separated)
  49 void LogConfigurationTest::SetUpTestCase() {
  50   char *pos = _all_decorators;
  51   for (size_t i = 0; i < LogDecorators::Count; i++) {
  52     pos += jio_snprintf(pos, sizeof(_all_decorators) - (pos - _all_decorators), "%s%s",
  53                         (i == 0 ? "" : ","),
  54                         LogDecorators::name(static_cast<LogDecorators::Decorator>(i)));




   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 "logTestFixture.hpp"
  27 #include "logTestUtils.inline.hpp"
  28 #include "logging/logConfiguration.hpp"
  29 #include "logging/logFileStreamOutput.hpp"
  30 #include "logging/logLevel.hpp"
  31 #include "logging/logOutput.hpp"
  32 #include "logging/logTag.hpp"
  33 #include "logging/logTagSet.hpp"
  34 #include "memory/resourceArea.hpp"

  35 #include "unittest.hpp"
  36 #include "utilities/ostream.hpp"
  37 
  38 class LogConfigurationTest : public LogTestFixture {
  39  protected:
  40   static char _all_decorators[256];
  41 
  42  public:
  43   static void SetUpTestCase();
  44 };
  45 
  46 char LogConfigurationTest::_all_decorators[256];
  47 
  48 // Prepare _all_decorators to contain the full list of decorators (comma separated)
  49 void LogConfigurationTest::SetUpTestCase() {
  50   char *pos = _all_decorators;
  51   for (size_t i = 0; i < LogDecorators::Count; i++) {
  52     pos += jio_snprintf(pos, sizeof(_all_decorators) - (pos - _all_decorators), "%s%s",
  53                         (i == 0 ? "" : ","),
  54                         LogDecorators::name(static_cast<LogDecorators::Decorator>(i)));


< prev index next >