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 "logging/logLevel.hpp"
26 #include "logging/logTagLevelExpression.hpp"
27 #include "logging/logTagSet.hpp"
28 #include "prims/jvm.h"
29 #include "unittest.hpp"
30 #include "utilities/globalDefinitions.hpp"
31
32 TEST(LogTagLevelExpression, combination_limit) {
33 size_t max_combinations = LogTagLevelExpression::MaxCombinations;
34 EXPECT_GT(max_combinations, LogTagSet::ntagsets())
35 << "Combination limit not sufficient for configuring all available tag sets";
36 }
37
38 TEST(LogTagLevelExpression, parse) {
39 char buf[256];
40 const char* invalid_substr[] = {
41 "=", "+", " ", "+=", "+=*", "*+", " +", "**", "++", ".", ",", ",," ",+",
42 " *", "all+", "all*", "+all", "+all=Warning", "==Info", "=InfoWarning",
43 "BadTag+", "logging++", "logging*+", ",=", "gc+gc+"
44 };
45 const char* valid_expression[] = {
46 "all", "gc", "gc,logging", "gc+logging", "logging+gc", "logging+gc,gc", "logging+gc*", "gc=trace",
47 "gc=trace,logging=info", "logging+gc=trace", "logging+gc=trace,gc+logging=warning,logging",
48 "gc,all=info", "logging*", "logging*=info", "gc+logging*=error", "logging*,gc=info"
|
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 "logging/logLevel.hpp"
27 #include "logging/logTagLevelExpression.hpp"
28 #include "logging/logTagSet.hpp"
29 #include "unittest.hpp"
30 #include "utilities/globalDefinitions.hpp"
31
32 TEST(LogTagLevelExpression, combination_limit) {
33 size_t max_combinations = LogTagLevelExpression::MaxCombinations;
34 EXPECT_GT(max_combinations, LogTagSet::ntagsets())
35 << "Combination limit not sufficient for configuring all available tag sets";
36 }
37
38 TEST(LogTagLevelExpression, parse) {
39 char buf[256];
40 const char* invalid_substr[] = {
41 "=", "+", " ", "+=", "+=*", "*+", " +", "**", "++", ".", ",", ",," ",+",
42 " *", "all+", "all*", "+all", "+all=Warning", "==Info", "=InfoWarning",
43 "BadTag+", "logging++", "logging*+", ",=", "gc+gc+"
44 };
45 const char* valid_expression[] = {
46 "all", "gc", "gc,logging", "gc+logging", "logging+gc", "logging+gc,gc", "logging+gc*", "gc=trace",
47 "gc=trace,logging=info", "logging+gc=trace", "logging+gc=trace,gc+logging=warning,logging",
48 "gc,all=info", "logging*", "logging*=info", "gc+logging*=error", "logging*,gc=info"
|