mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
Change-Id: I236218a73bd7dac6e5744e3596f146b77b5ca1c8 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
28 lines
633 B
C++
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
|