Home | History | Annotate | Download | only in trunks
      1 //
      2 // Copyright (C) 2014 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 "trunks/mock_tpm_state.h"
     18 
     19 #include <gmock/gmock.h>
     20 
     21 using testing::Return;
     22 
     23 namespace trunks {
     24 
     25 MockTpmState::MockTpmState() {
     26   ON_CALL(*this, IsOwnerPasswordSet()).WillByDefault(Return(true));
     27   ON_CALL(*this, IsEndorsementPasswordSet()).WillByDefault(Return(true));
     28   ON_CALL(*this, IsLockoutPasswordSet()).WillByDefault(Return(true));
     29   ON_CALL(*this, IsOwned()).WillByDefault(Return(true));
     30   ON_CALL(*this, IsPlatformHierarchyEnabled()).WillByDefault(Return(true));
     31   ON_CALL(*this, IsStorageHierarchyEnabled()).WillByDefault(Return(true));
     32   ON_CALL(*this, IsEndorsementHierarchyEnabled()).WillByDefault(Return(true));
     33   ON_CALL(*this, IsEnabled()).WillByDefault(Return(true));
     34   ON_CALL(*this, WasShutdownOrderly()).WillByDefault(Return(true));
     35   ON_CALL(*this, IsRSASupported()).WillByDefault(Return(true));
     36   ON_CALL(*this, IsECCSupported()).WillByDefault(Return(true));
     37   ON_CALL(*this, GetLockoutCounter()).WillByDefault(Return(0));
     38   ON_CALL(*this, GetLockoutThreshold()).WillByDefault(Return(0));
     39   ON_CALL(*this, GetLockoutInterval()).WillByDefault(Return(0));
     40   ON_CALL(*this, GetLockoutRecovery()).WillByDefault(Return(0));
     41 }
     42 
     43 MockTpmState::~MockTpmState() {}
     44 
     45 }  // namespace trunks
     46