PageRenderTime 14ms CodeModel.GetById 9ms RepoModel.GetById 1ms app.codeStats 0ms

/core/externals/update-engine/externals/google-toolbox-for-mac/AppKit/GTMNSImage+SearchCacheTest.m

http://macfuse.googlecode.com/
Objective C | 60 lines | 28 code | 14 blank | 18 comment | 0 complexity | af012910ea47632fce578286f54eea35 MD5 | raw file
Possible License(s): Apache-2.0, BSD-3-Clause, GPL-2.0
  1. //
  2. // GTMNSImage+SearchCacheTest.m
  3. //
  4. // Copyright 2006-2008 Google Inc.
  5. //
  6. // Licensed under the Apache License, Version 2.0 (the "License"); you may not
  7. // use this file except in compliance with the License. You may obtain a copy
  8. // of the License at
  9. //
  10. // http://www.apache.org/licenses/LICENSE-2.0
  11. //
  12. // Unless required by applicable law or agreed to in writing, software
  13. // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  14. // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  15. // License for the specific language governing permissions and limitations under
  16. // the License.
  17. //
  18. #import <Cocoa/Cocoa.h>
  19. #import "GTMSenTestCase.h"
  20. #import "GTMNSImage+SearchCache.h"
  21. #import "GTMGeometryUtils.h"
  22. @interface GTMNSImage_SearchCacheTest : GTMTestCase
  23. @end
  24. @implementation GTMNSImage_SearchCacheTest
  25. - (void)testSearchCache {
  26. NSImage *testImage = [NSImage gtm_imageNamed:@"NSApplicationIcon"];
  27. STAssertNotNil(testImage, nil);
  28. testImage = [NSImage gtm_imageNamed:@"com.apple.Xcode"];
  29. STAssertNotNil(testImage, nil);
  30. #if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
  31. // The stencil images only exist on 10.5+
  32. testImage = [NSImage gtm_imageNamed:NSImageNameBonjour];
  33. STAssertNotNil(testImage, nil);
  34. #endif // MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
  35. testImage = [NSImage gtm_imageNamed:(NSString *)kUTTypeFolder];
  36. STAssertNotNil(testImage, nil);
  37. testImage = [NSImage gtm_imageNamed:@"~/Library"];
  38. STAssertNotNil(testImage, nil);
  39. testImage = [NSImage gtm_imageNamed:@"'APPL'"];
  40. STAssertNotNil(testImage, nil);
  41. testImage = [NSImage gtm_imageNamed:@"ponies for sale"];
  42. STAssertNil(testImage, nil);
  43. testImage = [NSImage gtm_imageNamed:@"/An/Invalid/Path"];
  44. STAssertNil(testImage, nil);
  45. }
  46. @end