diff --git a/.github/workflows/test-storage-cache.yml b/.github/workflows/test-storage-cache.yml index 899e0dac1..63557652b 100644 --- a/.github/workflows/test-storage-cache.yml +++ b/.github/workflows/test-storage-cache.yml @@ -48,6 +48,7 @@ jobs: strategy: matrix: test: + - IndicatorCalculateCache.test - ObjectsCache.test steps: - uses: actions/download-artifact@v2 diff --git a/Indicator/Indicator.struct.h b/Indicator/Indicator.struct.h index 59e498e1e..f2db3d4d4 100644 --- a/Indicator/Indicator.struct.h +++ b/Indicator/Indicator.struct.h @@ -42,7 +42,7 @@ struct ChartParams; #include "../Storage/DateTime.struct.h" #include "../Serializer/SerializerNode.enum.h" #include "Indicator.enum.h" -#include "IndicatorData.struct.cache.h" +#include "../Storage/Cache/IndicatorCalculateCache.h" //#include "Indicator.struct.serialize.h" /* Structure for indicator parameters. */ diff --git a/Indicator/IndicatorData.h b/Indicator/IndicatorData.h index 9825c22ab..138f08fd7 100644 --- a/Indicator/IndicatorData.h +++ b/Indicator/IndicatorData.h @@ -48,7 +48,7 @@ struct ExternInstantiateIndicatorBufferValueStorageDouble { #include "Indicator.enum.h" #include "IndicatorBase.h" #include "IndicatorData.enum.h" -#include "IndicatorData.struct.cache.h" +#include "../Storage/Cache/IndicatorCalculateCache.h" #include "IndicatorData.struct.h" #include "IndicatorData.struct.serialize.h" #include "IndicatorData.struct.signal.h" diff --git a/Indicator/IndicatorData.struct.cache.h b/Storage/Cache/IndicatorCalculateCache.h similarity index 99% rename from Indicator/IndicatorData.struct.cache.h rename to Storage/Cache/IndicatorCalculateCache.h index 610646d0b..a7a125a69 100644 --- a/Indicator/IndicatorData.struct.cache.h +++ b/Storage/Cache/IndicatorCalculateCache.h @@ -31,8 +31,8 @@ #endif // Includes. -#include "../Refs.mqh" -#include "../Storage/ValueStorage.h" +#include "../../Refs.mqh" +#include "../ValueStorage.h" /** * Holds buffers used to cache values calculated via OnCalculate methods. diff --git a/Storage/Cache/tests/IndicatorCalculateCache.test.cpp b/Storage/Cache/tests/IndicatorCalculateCache.test.cpp new file mode 100644 index 000000000..3c2196816 --- /dev/null +++ b/Storage/Cache/tests/IndicatorCalculateCache.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://github.com/EA31337 | +//+------------------------------------------------------------------+ + +/* + * 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 IndicatorCalculateCache class. + */ + +// Includes. +#include "../IndicatorCalculateCache.h" + +int main(int argc, char **argv) { + + // @todo: Add more tests. + // ... + + return 0; +} diff --git a/Storage/Cache/tests/IndicatorCalculateCache.test.mq4 b/Storage/Cache/tests/IndicatorCalculateCache.test.mq4 new file mode 100644 index 000000000..a6d801da3 --- /dev/null +++ b/Storage/Cache/tests/IndicatorCalculateCache.test.mq4 @@ -0,0 +1,28 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://github.com/EA31337 | +//+------------------------------------------------------------------+ + +/* + * 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 functionality of IndicatorCalculateCache class. + */ + +// Includes. +#include "IndicatorCalculateCache.test.mq5" diff --git a/Storage/Cache/tests/IndicatorCalculateCache.test.mq5 b/Storage/Cache/tests/IndicatorCalculateCache.test.mq5 new file mode 100644 index 000000000..0c1f91fe3 --- /dev/null +++ b/Storage/Cache/tests/IndicatorCalculateCache.test.mq5 @@ -0,0 +1,40 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://github.com/EA31337 | +//+------------------------------------------------------------------+ + +/* + * 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 functionality of ObjectsCache class. + */ + +// Includes. +#include "../../../Test.mqh" +#include "../IndicatorCalculateCache.h" + +/** + * Implements OnInit(). + */ +int OnInit() { + + // @todo: Add more tests. + // ... + + return (GetLastError() > 0 ? INIT_FAILED : INIT_SUCCEEDED); +}