TestBubbleLog.cxx
Go to the documentation of this file.
1 /*===========================================================================================================
2  *
3  * SHA-L - Simple Hybesis Algorithm Logger
4  *
5  * Copyright (c) Michael Jeulin-Lagarrigue
6  *
7  * Licensed under the MIT License, you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * https://github.com/michael-jeulinl/Simple-Hybesis-Algorithms-Logger/blob/master/LICENSE
11  *
12  * Unless required by applicable law or agreed to in writing, software distributed under the License is
13  * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and limitations under the License.
15  *
16  * The above copyright notice and this permission notice shall be included in all copies or
17  * substantial portions of the Software.
18  *
19  *=========================================================================================================*/
20 #include <gtest/gtest.h>
21 #include <bubble_log.hxx>
22 
23 // STD includes
24 #include <fstream>
25 #include <functional>
26 #include <vector>
27 
28 // Testing namespace
29 using namespace SHA_Logger;
30 
31 #ifndef DOXYGEN_SKIP
32 namespace {
33  // Simple random array of integers with negative values
34  //const int RandomArrayInt[] = {40, 80, -10, 50, 1, 65, -80, 26, -20, -35, 35, 35, -70, 100, -50};
35  const int RandomArrayInt[] = {-1, 6, -4, 5, 8, 4, -5, -6, 7, 0, 2, -2, -3, 3, 3, -7, -8, 1};
36 
37  typedef std::vector<int> Container;
38  typedef Container::iterator IT;
39 }
40 #endif /* DOXYGEN_SKIP */
41 
42 // Test TestAlgo Construction
43 TEST(TestBubbleLog, build)
44 {
45  Container randomdArray(RandomArrayInt, RandomArrayInt + sizeof(RandomArrayInt) / sizeof(int));
46  OFStream fileStream("bubble_output.json");
47  BubbleLog<IT>::Build(fileStream, OpGetMin, randomdArray.begin(), randomdArray.end());
48 }
TEST(TestBubbleLog, build)
static Ostream & Build(Ostream &os, Options opts, const IT &begin, const IT &end)
Definition: bubble_log.hxx:65
std::ofstream OFStream
Definition: typedef.hxx:38