Files
compute-runtime/unit_tests/utilities/destructor_counted.h
Mateusz Jablonski 4f028d13a1 Command stream receiver: use memory manager from execution environment
Change-Id: I236218a73bd7dac6e5744e3596f146b77b5ca1c8
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2018-10-16 12:14:55 +02:00

28 lines
633 B
C++

/*
* Copyright (C) 2018 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include "test.h"
namespace OCLRT {
template <typename BaseType, uint32_t ordinal>
struct DestructorCounted : public BaseType {
template <typename... Args>
DestructorCounted(uint32_t &destructorId, Args &&... args) : BaseType(std::forward<Args>(args)...),
destructorId(destructorId) {}
~DestructorCounted() override {
EXPECT_EQ(ordinal, destructorId);
destructorId++;
}
private:
uint32_t &destructorId;
};
} // namespace OCLRT