| 
									
										
										
										
											2015-09-18 17:01:32 +02:00
										 |  |  | /****************************************************************************
 | 
					
						
							|  |  |  | ** | 
					
						
							| 
									
										
										
										
											2016-01-15 14:55:33 +01:00
										 |  |  | ** Copyright (C) 2016 The Qt Company Ltd. | 
					
						
							|  |  |  | ** Contact: https://www.qt.io/licensing/
 | 
					
						
							| 
									
										
										
										
											2015-09-18 17:01:32 +02:00
										 |  |  | ** | 
					
						
							|  |  |  | ** This file is part of Qt Creator. | 
					
						
							|  |  |  | ** | 
					
						
							|  |  |  | ** Commercial License Usage | 
					
						
							|  |  |  | ** Licensees holding valid commercial Qt licenses may use this file in | 
					
						
							|  |  |  | ** accordance with the commercial license agreement provided with the | 
					
						
							|  |  |  | ** Software or, alternatively, in accordance with the terms contained in | 
					
						
							| 
									
										
										
										
											2016-01-15 14:55:33 +01:00
										 |  |  | ** a written agreement between you and The Qt Company. For licensing terms | 
					
						
							|  |  |  | ** and conditions see https://www.qt.io/terms-conditions. For further
 | 
					
						
							|  |  |  | ** information use the contact form at https://www.qt.io/contact-us.
 | 
					
						
							| 
									
										
										
										
											2015-09-18 17:01:32 +02:00
										 |  |  | ** | 
					
						
							| 
									
										
										
										
											2016-01-15 14:55:33 +01:00
										 |  |  | ** GNU General Public License Usage | 
					
						
							|  |  |  | ** Alternatively, this file may be used under the terms of the GNU | 
					
						
							|  |  |  | ** General Public License version 3 as published by the Free Software | 
					
						
							|  |  |  | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT | 
					
						
							|  |  |  | ** included in the packaging of this file. Please review the following | 
					
						
							|  |  |  | ** information to ensure the GNU General Public License requirements will | 
					
						
							|  |  |  | ** be met: https://www.gnu.org/licenses/gpl-3.0.html.
 | 
					
						
							| 
									
										
										
										
											2015-09-18 17:01:32 +02:00
										 |  |  | ** | 
					
						
							|  |  |  | ****************************************************************************/ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-11-30 11:27:06 +01:00
										 |  |  | #include "googletest.h"
 | 
					
						
							| 
									
										
										
										
											2015-09-18 17:01:32 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | namespace { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | using ::testing::PrintToString; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | MATCHER_P(IsDiagnosticContainer, diagnosticContainer, "") | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2018-04-04 18:25:23 +02:00
										 |  |  |     if (arg.text != diagnosticContainer.text) { | 
					
						
							|  |  |  |         *result_listener << "text is " + PrintToString(arg.text) | 
					
						
							|  |  |  |                             + " and not " + PrintToString(diagnosticContainer.text); | 
					
						
							| 
									
										
										
										
											2015-09-18 17:01:32 +02:00
										 |  |  |         return false; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-04 18:25:23 +02:00
										 |  |  |     if (arg.location != diagnosticContainer.location) { | 
					
						
							|  |  |  |         *result_listener << "location is " + PrintToString(arg.location) | 
					
						
							|  |  |  |                             + " and not " + PrintToString(diagnosticContainer.location); | 
					
						
							| 
									
										
										
										
											2015-09-18 17:01:32 +02:00
										 |  |  |         return false; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-04 18:25:23 +02:00
										 |  |  |     if (arg.children != diagnosticContainer.children) { | 
					
						
							|  |  |  |         *result_listener << "children are " + PrintToString(arg.children) | 
					
						
							|  |  |  |                             + " and not " + PrintToString(diagnosticContainer.children); | 
					
						
							| 
									
										
										
										
											2015-09-18 17:01:32 +02:00
										 |  |  |         return false; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return true; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } // anonymous
 |