FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
testUtils.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015, Siemens AG
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License version 2
6  * as published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11  * See the GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software Foundation,
15  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16  */
17 
18 #ifndef FOSSOLOGY_TESTUTILS_HPP
19 #define FOSSOLOGY_TESTUTILS_HPP
20 
21 #include <iostream>
22 #include <vector>
23 
38 std::ostream& operator <<(std::ostream& os, const std::vector<int>& x)
39 {
40  typedef std::vector<int>::const_iterator cpm;
41  os << "[";
42  bool first = true;
43  for (cpm it = x.begin(); it != x.end(); ++it) {
44  if (!first) {
45  os << ", ";
46  }
47  first = false;
48  os << *it;
49  }
50  return os << "]";
51 }
52 
53 #endif //FOSSOLOGY_TESTUTILS_HPP