/core/externals/update-engine/Core/KSMemoryTicketStoreTest.m

http://macfuse.googlecode.com/ · Objective C · 58 lines · 26 code · 12 blank · 20 comment · 0 complexity · 041e2b4792a970a00ddb20929d7589ab MD5 · raw file

  1. // Copyright 2008 Google Inc.
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. #import <SenTestingKit/SenTestingKit.h>
  15. #import "KSTicketStoreTest.h"
  16. #import "KSMemoryTicketStore.h"
  17. // Most test methods are inherited from KSTicketStoreTest. This class overrides
  18. // setUp and tearDown to set the protected |store_| var to the correct subclass
  19. // to be tested.
  20. @interface KSMemoryTicketStoreTest : KSTicketStoreTest
  21. // Override to do nothing because KSMemoryTicketStore instances do not serialize
  22. // objects to disk at all, so encoding/decoding is never used (it defeats the
  23. // purpose of the class).
  24. - (void)testEncodeDecode;
  25. @end
  26. @implementation KSMemoryTicketStoreTest
  27. - (void)setUp {
  28. store_ = [[KSMemoryTicketStore alloc] initWithPath:nil];
  29. [super setUp];
  30. }
  31. - (void)tearDown {
  32. [store_ release];
  33. store_ = nil;
  34. }
  35. - (void)testInitialization {
  36. KSTicketStore *store = [[[KSMemoryTicketStore alloc] init] autorelease];
  37. STAssertNotNil(store, nil);
  38. store = [KSMemoryTicketStore ticketStoreWithPath:nil];
  39. STAssertNotNil(store, nil);
  40. store = [KSMemoryTicketStore ticketStoreWithPath:@"/tmp/foo"];
  41. STAssertNil(store, nil);
  42. }
  43. - (void)testEncodeDecode {
  44. // Override parent's imp to do nothing.
  45. }
  46. @end