2 * Copyright (C) 2014 The Android Open Source Project
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef H_AAPT_SPLIT_TEST_RULES
18 #define H_AAPT_SPLIT_TEST_RULES
22 #include <gtest/gtest.h>
27 struct AndRule : public Rule {
29 op = Rule::AND_SUBRULES;
32 AndRule& add(const Rule& rhs) {
33 subrules.add(new Rule(rhs));
38 struct OrRule : public Rule {
40 op = Rule::OR_SUBRULES;
43 OrRule& add(const Rule& rhs) {
44 subrules.add(new Rule(rhs));
49 const Rule EqRule(Rule::Key key, long value);
50 const Rule LtRule(Rule::Key key, long value);
51 const Rule GtRule(Rule::Key key, long value);
52 const Rule ContainsAnyRule(Rule::Key key, const char* str1);
53 const Rule ContainsAnyRule(Rule::Key key, const char* str1, const char* str2);
54 const Rule AlwaysTrue();
56 ::testing::AssertionResult RulePredFormat(
57 const char* actualExpr, const char* expectedExpr,
58 const android::sp<Rule>& actual, const Rule& expected);
60 #define EXPECT_RULES_EQ(actual, expected) \
61 EXPECT_PRED_FORMAT2(::split::test::RulePredFormat, actual, expected)
66 #endif // H_AAPT_SPLIT_TEST_RULES