Skip to content

Commit

Permalink
Renames IndicatorData.struct.cache.h to Storage/Cache/IndicatorCalcul…
Browse files Browse the repository at this point in the history
…ateCache.h (GH-556)
  • Loading branch information
kenorb committed Jun 17, 2023
1 parent d341334 commit 1bc9b84
Show file tree
Hide file tree
Showing 7 changed files with 109 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test-storage-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jobs:
strategy:
matrix:
test:
- IndicatorCalculateCache.test
- ObjectsCache.test
steps:
- uses: actions/download-artifact@v2
Expand Down
2 changes: 1 addition & 1 deletion Indicator/Indicator.struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
2 changes: 1 addition & 1 deletion Indicator/IndicatorData.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
36 changes: 36 additions & 0 deletions Storage/Cache/tests/IndicatorCalculateCache.test.cpp
Original file line number Diff line number Diff line change
@@ -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 <http://www.gnu.org/licenses/>.
*/

/**
* @file
* Test C++ compilation of IndicatorCalculateCache class.
*/

// Includes.
#include "../IndicatorCalculateCache.h"

int main(int argc, char **argv) {

// @todo: Add more tests.
// ...

return 0;
}
28 changes: 28 additions & 0 deletions Storage/Cache/tests/IndicatorCalculateCache.test.mq4
Original file line number Diff line number Diff line change
@@ -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 <http://www.gnu.org/licenses/>.
*/

/**
* @file
* Test functionality of IndicatorCalculateCache class.
*/

// Includes.
#include "IndicatorCalculateCache.test.mq5"
40 changes: 40 additions & 0 deletions Storage/Cache/tests/IndicatorCalculateCache.test.mq5
Original file line number Diff line number Diff line change
@@ -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 <http://www.gnu.org/licenses/>.
*/

/**
* @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);
}

0 comments on commit 1bc9b84

Please sign in to comment.