From 086653166078fab0628d1c32a0cee8c0d84bafde Mon Sep 17 00:00:00 2001 From: Olivier Halligon Date: Sun, 22 Nov 2015 20:23:02 +0100 Subject: [PATCH] Unit Tests + CHANGELOG for #56 --- CHANGELOG.md | 5 +++++ .../expected/Colors-File-CustomName.swift.out | 16 +++++++--------- .../expected/Colors-File-Defaults.swift.out | 16 +++++++--------- .../expected/Colors-List-Defaults.swift.out | 12 +++++------- 4 files changed, 24 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 47f7a203f..3d8dcef85 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,11 @@ _You can add translations to your own templates by using the `string.translation` variable._ [@MrAlek](https://github.com/MrAlek), [#58](https://github.com/AliSoftware/SwiftGen/issues/58), [#60](https://github.com/AliSoftware/SwiftGen/pull/60) +#### Fixes + +* Fix an issue with the colors template due to an Apple Bug when building in Release and with WMO enabled. + [#56](https://github.com/AliSoftware/SwiftGen/issues/58) + ## 0.7.1 #### Fixes diff --git a/UnitTests/expected/Colors-File-CustomName.swift.out b/UnitTests/expected/Colors-File-CustomName.swift.out index 9c2dc4f16..9747504d0 100644 --- a/UnitTests/expected/Colors-File-CustomName.swift.out +++ b/UnitTests/expected/Colors-File-CustomName.swift.out @@ -31,16 +31,14 @@ extension UIColor { /// Alpha: 80%
(0xffffffcc) case Translucent - static let rgbaValues: [XCTColors:UInt32] = [ - .ArticleBody : 0x339666ff, - .ArticleFootnote : 0xff66ccff, - .ArticleTitle : 0x33fe66ff, - .Cyan_Color : 0xff66ccff, - .Translucent : 0xffffffcc, - ] - var rgbaValue: UInt32! { - return XCTColors.rgbaValues[self] + switch self { + case .ArticleBody: return 0x339666ff + case .ArticleFootnote: return 0xff66ccff + case .ArticleTitle: return 0x33fe66ff + case .Cyan_Color: return 0xff66ccff + case .Translucent: return 0xffffffcc + } } } diff --git a/UnitTests/expected/Colors-File-Defaults.swift.out b/UnitTests/expected/Colors-File-Defaults.swift.out index cf0831e92..a5ff47211 100644 --- a/UnitTests/expected/Colors-File-Defaults.swift.out +++ b/UnitTests/expected/Colors-File-Defaults.swift.out @@ -31,16 +31,14 @@ extension UIColor { /// Alpha: 80%
(0xffffffcc) case Translucent - static let rgbaValues: [Name:UInt32] = [ - .ArticleBody : 0x339666ff, - .ArticleFootnote : 0xff66ccff, - .ArticleTitle : 0x33fe66ff, - .Cyan_Color : 0xff66ccff, - .Translucent : 0xffffffcc, - ] - var rgbaValue: UInt32! { - return Name.rgbaValues[self] + switch self { + case .ArticleBody: return 0x339666ff + case .ArticleFootnote: return 0xff66ccff + case .ArticleTitle: return 0x33fe66ff + case .Cyan_Color: return 0xff66ccff + case .Translucent: return 0xffffffcc + } } } diff --git a/UnitTests/expected/Colors-List-Defaults.swift.out b/UnitTests/expected/Colors-List-Defaults.swift.out index cefe99c04..ea1125cd6 100644 --- a/UnitTests/expected/Colors-List-Defaults.swift.out +++ b/UnitTests/expected/Colors-List-Defaults.swift.out @@ -25,14 +25,12 @@ extension UIColor { /// Alpha: 100%
(0x999999ff) case Text_Body_Color - static let rgbaValues: [Name:UInt32] = [ - .ArticleBackground : 0xffcc0099, - .ArticleTitle : 0x996600ff, - .Text_Body_Color : 0x999999ff, - ] - var rgbaValue: UInt32! { - return Name.rgbaValues[self] + switch self { + case .ArticleBackground: return 0xffcc0099 + case .ArticleTitle: return 0x996600ff + case .Text_Body_Color: return 0x999999ff + } } }