(self)
| 1137 | ) |
| 1138 | |
| 1139 | def testIncludeWhatYouUse(self): |
| 1140 | self.TestIncludeWhatYouUse( |
| 1141 | """#include <vector> |
| 1142 | std::vector<int> foo; |
| 1143 | """, |
| 1144 | "", |
| 1145 | ) |
| 1146 | self.TestIncludeWhatYouUse( |
| 1147 | """#include <map> |
| 1148 | std::pair<int,int> foo; |
| 1149 | """, |
| 1150 | "Add #include <utility> for pair<> [build/include_what_you_use] [4]", |
| 1151 | ) |
| 1152 | self.TestIncludeWhatYouUse( |
| 1153 | """#include <multimap> |
| 1154 | std::pair<int,int> foo; |
| 1155 | """, |
| 1156 | "Add #include <utility> for pair<> [build/include_what_you_use] [4]", |
| 1157 | ) |
| 1158 | self.TestIncludeWhatYouUse( |
| 1159 | """#include <hash_map> |
| 1160 | std::pair<int,int> foo; |
| 1161 | """, |
| 1162 | "Add #include <utility> for pair<> [build/include_what_you_use] [4]", |
| 1163 | ) |
| 1164 | self.TestIncludeWhatYouUse( |
| 1165 | """#include <hash_map> |
| 1166 | auto foo = std::make_pair(1, 2); |
| 1167 | """, |
| 1168 | "Add #include <utility> for make_pair [build/include_what_you_use] [4]", |
| 1169 | ) |
| 1170 | self.TestIncludeWhatYouUse( |
| 1171 | """#include <utility> |
| 1172 | std::pair<int,int> foo; |
| 1173 | """, |
| 1174 | "", |
| 1175 | ) |
| 1176 | self.TestIncludeWhatYouUse( |
| 1177 | """#include <vector> |
| 1178 | DECLARE_string(foobar); |
| 1179 | """, |
| 1180 | "", |
| 1181 | ) |
| 1182 | self.TestIncludeWhatYouUse( |
| 1183 | """#include <vector> |
| 1184 | DEFINE_string(foobar, "", ""); |
| 1185 | """, |
| 1186 | "", |
| 1187 | ) |
| 1188 | self.TestIncludeWhatYouUse( |
| 1189 | """#include <vector> |
| 1190 | std::pair<int,int> foo; |
| 1191 | """, |
| 1192 | "Add #include <utility> for pair<> [build/include_what_you_use] [4]", |
| 1193 | ) |
| 1194 | self.TestIncludeWhatYouUse( |
| 1195 | """#include "base/foobar.h" |
| 1196 | std::vector<int> foo; |
nothing calls this directly
no test coverage detected