FIRCLSdSYMTests.m 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // Copyright 2019 Google
  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 "Crashlytics/UnitTests/FIRCLSMachO/FIRCLSdSYMTests.h"
  15. #import "Crashlytics/Shared/FIRCLSMachO/FIRCLSdSYM.h"
  16. @implementation FIRCLSdSYMTests
  17. - (NSString*)resourcePath {
  18. return [[NSBundle bundleForClass:[self class]] resourcePath];
  19. }
  20. - (void)testBundleIdAndExecutablePath {
  21. FIRCLSdSYM* dSYM;
  22. NSString* path;
  23. path = [[self resourcePath] stringByAppendingPathComponent:@"i386-simulator.dSYM"];
  24. dSYM = [FIRCLSdSYM dSYMWithURL:[NSURL fileURLWithPath:path]];
  25. XCTAssertEqualObjects(@"com.crashlytics.ios.CrashTest", [dSYM bundleIdentifier], @"");
  26. XCTAssertTrue([[dSYM executablePath] hasSuffix:@"CrashTest"], @"");
  27. }
  28. - (void)testUUIDsInFatFile {
  29. FIRCLSdSYM* dSYM;
  30. NSString* path;
  31. NSMutableDictionary* uuids;
  32. path = [[self resourcePath] stringByAppendingPathComponent:@"armv7-armv7s.dSYM"];
  33. dSYM = [FIRCLSdSYM dSYMWithURL:[NSURL fileURLWithPath:path]];
  34. uuids = [NSMutableDictionary dictionary];
  35. [dSYM enumerateUUIDs:^(NSString* uuid, NSString* architecture) {
  36. [uuids setObject:uuid forKey:architecture];
  37. }];
  38. XCTAssertEqual((NSUInteger)2, [uuids count], @"");
  39. XCTAssertEqualObjects([uuids objectForKey:@"armv7"], @"794523cb14ef3e6bb32a4ea39a7ac677", @"");
  40. XCTAssertEqualObjects([uuids objectForKey:@"armv7s"], @"0d1450b08b5e35b8bf1e442b7be4666b", @"");
  41. }
  42. @end