mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-10-30 22:34:02 +01:00 
			
		
		
		
	5204: Fix unit test UploadMediaPresenterTest.handleImageResult (#5206)
* UploadMediaPresenterTest: fix failing unit tests * change else if to if condition to handle all cases * include errorCodes 68 for duplicate image and 96 for image without exif * optimise if statements * remove redundant cases * modify if statements to cover all cases * simplify all if statements * add removed comment again * remove unused imports
This commit is contained in:
		
							parent
							
								
									2c7f2d05cd
								
							
						
					
					
						commit
						a116a17e7b
					
				
					 2 changed files with 5 additions and 14 deletions
				
			
		|  | @ -3,12 +3,7 @@ package fr.free.nrw.commons.upload.mediaDetails; | |||
| import static fr.free.nrw.commons.di.CommonsApplicationModule.IO_THREAD; | ||||
| import static fr.free.nrw.commons.di.CommonsApplicationModule.MAIN_THREAD; | ||||
| import static fr.free.nrw.commons.utils.ImageUtils.EMPTY_CAPTION; | ||||
| import static fr.free.nrw.commons.utils.ImageUtils.FILE_FBMD; | ||||
| import static fr.free.nrw.commons.utils.ImageUtils.FILE_NAME_EXISTS; | ||||
| import static fr.free.nrw.commons.utils.ImageUtils.FILE_NO_EXIF; | ||||
| import static fr.free.nrw.commons.utils.ImageUtils.IMAGE_BLURRY; | ||||
| import static fr.free.nrw.commons.utils.ImageUtils.IMAGE_DARK; | ||||
| import static fr.free.nrw.commons.utils.ImageUtils.IMAGE_GEOLOCATION_DIFFERENT; | ||||
| import static fr.free.nrw.commons.utils.ImageUtils.IMAGE_KEEP; | ||||
| import static fr.free.nrw.commons.utils.ImageUtils.IMAGE_OK; | ||||
| 
 | ||||
|  | @ -331,11 +326,8 @@ public class UploadMediaPresenter implements UserActionListener, SimilarImageInt | |||
|             view.showDuplicatePicturePopup(uploadItem); | ||||
|         } | ||||
| 
 | ||||
|         // If image has some problems check if the bits are set in errorCode and | ||||
|         // show popup accordingly | ||||
|         if (((errorCode & FILE_NO_EXIF) != 0) || ((errorCode & IMAGE_DARK) != 0) || | ||||
|             ((errorCode & FILE_FBMD) != 0) || ((errorCode & IMAGE_GEOLOCATION_DIFFERENT) != 0) || | ||||
|             ((errorCode & IMAGE_BLURRY) != 0)) { | ||||
|         // If image has some other problems, show popup accordingly | ||||
|         if (errorCode != EMPTY_CAPTION && errorCode != FILE_NAME_EXISTS) { | ||||
|             view.showBadImagePopup(errorCode, uploadItem); | ||||
|         } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Ritika Pahwa
						Ritika Pahwa