• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2012 The Android Open Source Project
3  *
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
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16 
17 #include <gtest/gtest.h>
18 
19 #include "TestExtensions.h"
20 
21 namespace android {
22 namespace camera2 {
23 namespace tests {
24 
25 // Intentionally disabled since 2 of these tests are supposed to fail
26 class DISABLED_ForkedTest : public ::testing::Test {
27 
SetUp()28     virtual void SetUp() {
29         TEST_EXTENSION_FORKING_SET_UP;
30     }
31 
TearDown()32     virtual void TearDown() {
33         TEST_EXTENSION_FORKING_TEAR_DOWN;
34     }
35 };
36 
37 // intentionally fail
TEST_F(DISABLED_ForkedTest,FailCrash)38 TEST_F(DISABLED_ForkedTest, FailCrash) {
39     TEST_EXTENSION_FORKING_INIT;
40 
41     //intentionally crash
42     *(int*)0 = 0xDEADBEEF;
43 }
44 
TEST_F(DISABLED_ForkedTest,SucceedNormal)45 TEST_F(DISABLED_ForkedTest, SucceedNormal) {
46     TEST_EXTENSION_FORKING_INIT;
47 
48     EXPECT_TRUE(true);
49 }
50 
51 // intentionally fail
TEST_F(DISABLED_ForkedTest,FailNormal)52 TEST_F(DISABLED_ForkedTest, FailNormal) {
53     TEST_EXTENSION_FORKING_INIT;
54 
55     EXPECT_TRUE(false);
56 }
57 
58 }
59 }
60 }
61 
62