Skip to content

Commit

Permalink
CI: Adds tests for Instances class
Browse files Browse the repository at this point in the history
  • Loading branch information
kenorb committed Sep 10, 2024
1 parent f6174a4 commit f54be8f
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/test-storage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
- Collection.test
- Database.test
- DateTime.test
- Instances.test
- ItemsHistory.test
- Object.test
- Redis.test
Expand Down
2 changes: 1 addition & 1 deletion Storage/Instances.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ T* Instances::instances[];
T* Instances<T>::instances[];
#endif

#endif // INSTANCES_MQH
#endif // INSTANCES_H
28 changes: 28 additions & 0 deletions Storage/tests/Instances.test.mq4
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//+------------------------------------------------------------------+
//| 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 <http://www.gnu.org/licenses/>.
*/

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

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

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

// Includes.
#include "../../Test.mqh"
#include "../Instances.h"

/**
* Implements OnInit().
*/
int OnInit() {
// Create a new object.
// Instances *obj = new Instances();

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

// Clean up.
// Instances::Delete(obj);

return (GetLastError() > 0 ? INIT_FAILED : INIT_SUCCEEDED);
}

0 comments on commit f54be8f

Please sign in to comment.