FOSSology  4.4.0
Open Source License Compliance by Open Source Software
testUtils.hpp
Go to the documentation of this file.
1 /*
2  SPDX-FileCopyrightText: © 2015 Siemens AG
3 
4  SPDX-License-Identifier: GPL-2.0-only
5 */
6 
7 #ifndef FOSSOLOGY_TESTUTILS_HPP
8 #define FOSSOLOGY_TESTUTILS_HPP
9 
10 #include <iostream>
11 #include <vector>
12 
27 std::ostream& operator <<(std::ostream& os, const std::vector<int>& x)
28 {
29  typedef std::vector<int>::const_iterator cpm;
30  os << "[";
31  bool first = true;
32  for (cpm it = x.begin(); it != x.end(); ++it) {
33  if (!first) {
34  os << ", ";
35  }
36  first = false;
37  os << *it;
38  }
39  return os << "]";
40 }
41 
42 #endif //FOSSOLOGY_TESTUTILS_HPP
std::ostream & operator<<(std::ostream &os, const std::vector< int > &x)
<< operator overload to appends a vector to an ostream object
Definition: testUtils.hpp:27