TestArray.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 <array.hxx>
22 
23 // STD includes
24 #include <string>
25 
26 using namespace SHA_Logger;
27 
28 #ifndef DOXYGEN_SKIP
29 namespace {
30  typedef Array<std::vector<int>::iterator> Array_Type;
31 }
32 #endif /* DOXYGEN_SKIP */
33 
34 // Test Array
35 TEST(TestArray, build)
36 {
37  // Empty sequence
38  {
39  std::vector<int> sequence;
40  Array_Type::Build(std::cout, "p_0", "begin", sequence.begin(), "end", sequence.end());
41  }
42 
43  // Simple sequence
44  {
45  std::vector<int> sequence;
46  sequence.push_back(2);
47  sequence.push_back(-1);
48  sequence.push_back(5);
49  sequence.push_back(7);
50  sequence.push_back(0);
51  Array_Type::Build(std::cout, "p_0", "begin", sequence.begin(), "end", sequence.end());
52  }
53 
54  // String sequence
55  {
56  std::string str = "StringToBeRespresentatedAsArray";
57  Array<std::string::iterator>::Build(std::cout, "p_0", "begin", str.begin(), "end", str.end());
58  }
59 }
TEST(TestArray, build)
Definition: TestArray.cxx:35
static Ostream & Build(Ostream &os, const String &name, const String &beginName, const IT &begin, const String &endName, const IT &end)
Definition: array.hxx:42