ams: support building unit test programs on windows/linux/macos

This commit is contained in:
Michael Scire
2022-03-06 12:08:20 -08:00
committed by SciresM
parent 9a38be201a
commit 64a97576d0
756 changed files with 33359 additions and 9372 deletions

View File

@@ -81,7 +81,7 @@ namespace ams::ddsf {
m_session_list.clear();
}
protected:
~IDevice() {
virtual ~IDevice() {
m_session_list.clear();
}
public:

View File

@@ -40,7 +40,7 @@ namespace ams::ddsf {
m_device_list.clear();
}
protected:
~IDriver() {
virtual ~IDriver() {
m_device_list.clear();
}
public:

View File

@@ -53,7 +53,7 @@ namespace ams::ddsf {
public:
IEventHandler() : m_holder(), m_user_data(0), m_is_initialized(false), m_is_registered(false) { /* ... */ }
~IEventHandler() {
virtual ~IEventHandler() {
if (this->IsRegistered()) {
this->Unlink();
}

View File

@@ -58,7 +58,7 @@ namespace ams::ddsf {
public:
ISession() : m_list_node(), m_device(nullptr), m_access_mode() { /* ... */ }
protected:
~ISession() { this->DetachDevice(); AMS_ASSERT(!this->IsOpen()); }
virtual ~ISession() { this->DetachDevice(); AMS_ASSERT(!this->IsOpen()); }
public:
void AddTo(List &list) {
list.push_back(*this);

View File

@@ -42,13 +42,13 @@ namespace ams::ddsf::impl {
public:
#if !(defined(AMS_BUILD_FOR_DEBUGGING) || defined(AMS_BUILD_FOR_AUDITING))
constexpr TypeTag() : m_class_name(nullptr), m_base(nullptr) { /* ... */}
constexpr TypeTag(const TypeTag &b) : m_class_name(nullptr), m_base(std::addressof(b)) { AMS_ASSERT(this != m_base); }
constexpr TypeTag(const TypeTag &b) : m_class_name(nullptr), m_base(std::addressof(b)) { if (!std::is_constant_evaluated()) { AMS_ASSERT(this != m_base); } }
constexpr TypeTag(const char *c) : m_class_name(nullptr), m_base(nullptr) { AMS_UNUSED(c); }
constexpr TypeTag(const char *c, const TypeTag &b) : m_class_name(nullptr), m_base(std::addressof(b)) { AMS_UNUSED(c); AMS_ASSERT(this != m_base); }
constexpr TypeTag(const char *c, const TypeTag &b) : m_class_name(nullptr), m_base(std::addressof(b)) { if (!std::is_constant_evaluated()) { AMS_UNUSED(c); AMS_ASSERT(this != m_base); } }
#else
constexpr TypeTag(const char *c) : m_class_name(c), m_base(nullptr) { /* ... */ }
constexpr TypeTag(const char *c, const TypeTag &b) : m_class_name(c), m_base(std::addressof(b)) { AMS_ASSERT(this != m_base); }
constexpr TypeTag(const char *c, const TypeTag &b) : m_class_name(c), m_base(std::addressof(b)) { if (!std::is_constant_evaluated()) { AMS_ASSERT(this != m_base); } }
#endif
constexpr const char * GetClassName() const { return m_class_name; }