Zach Johnson | 3b72a14 | 2014-08-25 16:44:56 -0700 | [diff] [blame] | 1 | /****************************************************************************** |
| 2 | * |
Jakub Pawlowski | 5b790fe | 2017-09-18 09:00:20 -0700 | [diff] [blame] | 3 | * Copyright 2014 Google, Inc. |
Zach Johnson | 3b72a14 | 2014-08-25 16:44:56 -0700 | [diff] [blame] | 4 | * |
| 5 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | * you may not use this file except in compliance with the License. |
| 7 | * You may obtain a copy of the License at: |
| 8 | * |
| 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | * |
| 11 | * Unless required by applicable law or agreed to in writing, software |
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | * See the License for the specific language governing permissions and |
| 15 | * limitations under the License. |
| 16 | * |
| 17 | ******************************************************************************/ |
| 18 | |
| 19 | #include <gtest/gtest.h> |
| 20 | |
Chris Manton | 408ffb6 | 2014-11-12 16:31:43 -0800 | [diff] [blame] | 21 | #include "osi/test/AllocationTestHarness.h" |
Zach Johnson | 3b72a14 | 2014-08-25 16:44:56 -0700 | [diff] [blame] | 22 | |
Chris Manton | 408ffb6 | 2014-11-12 16:31:43 -0800 | [diff] [blame] | 23 | #include "osi/include/allocation_tracker.h" |
Zach Johnson | 3b72a14 | 2014-08-25 16:44:56 -0700 | [diff] [blame] | 24 | |
| 25 | void AllocationTestHarness::SetUp() { |
Sharvil Nanavati | c0745da | 2014-11-13 01:04:19 -0800 | [diff] [blame] | 26 | allocation_tracker_init(); |
Zach Johnson | 3b72a14 | 2014-08-25 16:44:56 -0700 | [diff] [blame] | 27 | allocation_tracker_reset(); |
| 28 | } |
| 29 | |
| 30 | void AllocationTestHarness::TearDown() { |
Myles Watson | b55040c | 2016-10-19 13:15:34 -0700 | [diff] [blame] | 31 | EXPECT_EQ(0U, allocation_tracker_expect_no_allocations()) |
| 32 | << "not all memory freed"; |
Zach Johnson | 3b72a14 | 2014-08-25 16:44:56 -0700 | [diff] [blame] | 33 | } |