From b74eaebd0c90dd9ac03058cee6ce786c2f368950 Mon Sep 17 00:00:00 2001 From: kenorb Date: Tue, 10 Sep 2024 19:26:27 +0100 Subject: [PATCH] Adds Instances.test.cpp --- Storage/Instances.h | 3 ++- Storage/tests/Instances.test.cpp | 41 ++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 Storage/tests/Instances.test.cpp diff --git a/Storage/Instances.h b/Storage/Instances.h index e6faaed78..726bf072d 100644 --- a/Storage/Instances.h +++ b/Storage/Instances.h @@ -52,7 +52,8 @@ template #ifdef __MQL__ T* Instances::instances[]; #else -T* Instances::instances[]; +//T* Instances::instances[]; +ARRAY(T*, Instances::instances); #endif #endif // INSTANCES_H diff --git a/Storage/tests/Instances.test.cpp b/Storage/tests/Instances.test.cpp new file mode 100644 index 000000000..2dc6b3f7a --- /dev/null +++ b/Storage/tests/Instances.test.cpp @@ -0,0 +1,41 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2024, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * This file is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * @file + * Test C++ compilation of Instances class. + */ + +// Includes. +#include "../Instances.h" + +int main(int argc, char **argv) { + // Create a new object. + // Instances *obj = new Instances(); + + // @todo: Add more tests. + // ... + + // Clean up. + // Instances::Delete(obj); + + return 0; +}