@@ -55,11 +55,11 @@ func TestTargetBoardResolverUno(t *testing.T) {
55
55
NoError (t , err )
56
56
}
57
57
58
- targetPackage := context [ constants . CTX_TARGET_PACKAGE ].( * types. Package )
58
+ targetPackage := ctx . TargetPackage
59
59
require .Equal (t , "arduino" , targetPackage .PackageId )
60
- targetPlatform := context [ constants . CTX_TARGET_PLATFORM ].( * types. Platform )
60
+ targetPlatform := ctx . TargetPlatform
61
61
require .Equal (t , "avr" , targetPlatform .PlatformId )
62
- targetBoard := context [ constants . CTX_TARGET_BOARD ].( * types. Board )
62
+ targetBoard := ctx . TargetBoard
63
63
require .Equal (t , "uno" , targetBoard .BoardId )
64
64
require .Equal (t , "atmega328p" , targetBoard .Properties [constants .BUILD_PROPERTIES_BUILD_MCU ])
65
65
}
@@ -81,11 +81,11 @@ func TestTargetBoardResolverDue(t *testing.T) {
81
81
NoError (t , err )
82
82
}
83
83
84
- targetPackage := context [ constants . CTX_TARGET_PACKAGE ].( * types. Package )
84
+ targetPackage := ctx . TargetPackage
85
85
require .Equal (t , "arduino" , targetPackage .PackageId )
86
- targetPlatform := context [ constants . CTX_TARGET_PLATFORM ].( * types. Platform )
86
+ targetPlatform := ctx . TargetPlatform
87
87
require .Equal (t , "sam" , targetPlatform .PlatformId )
88
- targetBoard := context [ constants . CTX_TARGET_BOARD ].( * types. Board )
88
+ targetBoard := ctx . TargetBoard
89
89
require .Equal (t , "arduino_due_x" , targetBoard .BoardId )
90
90
require .Equal (t , "cortex-m3" , targetBoard .Properties [constants .BUILD_PROPERTIES_BUILD_MCU ])
91
91
}
@@ -107,11 +107,11 @@ func TestTargetBoardResolverMega1280(t *testing.T) {
107
107
NoError (t , err )
108
108
}
109
109
110
- targetPackage := context [ constants . CTX_TARGET_PACKAGE ].( * types. Package )
110
+ targetPackage := ctx . TargetPackage
111
111
require .Equal (t , "arduino" , targetPackage .PackageId )
112
- targetPlatform := context [ constants . CTX_TARGET_PLATFORM ].( * types. Platform )
112
+ targetPlatform := ctx . TargetPlatform
113
113
require .Equal (t , "avr" , targetPlatform .PlatformId )
114
- targetBoard := context [ constants . CTX_TARGET_BOARD ].( * types. Board )
114
+ targetBoard := ctx . TargetBoard
115
115
require .Equal (t , "mega" , targetBoard .BoardId )
116
116
require .Equal (t , "atmega1280" , targetBoard .Properties [constants .BUILD_PROPERTIES_BUILD_MCU ])
117
117
require .Equal (t , "AVR_MEGA" , targetBoard .Properties [constants .BUILD_PROPERTIES_BUILD_BOARD ])
@@ -134,11 +134,11 @@ func TestTargetBoardResolverMega2560(t *testing.T) {
134
134
NoError (t , err )
135
135
}
136
136
137
- targetPackage := context [ constants . CTX_TARGET_PACKAGE ].( * types. Package )
137
+ targetPackage := ctx . TargetPackage
138
138
require .Equal (t , "arduino" , targetPackage .PackageId )
139
- targetPlatform := context [ constants . CTX_TARGET_PLATFORM ].( * types. Platform )
139
+ targetPlatform := ctx . TargetPlatform
140
140
require .Equal (t , "avr" , targetPlatform .PlatformId )
141
- targetBoard := context [ constants . CTX_TARGET_BOARD ].( * types. Board )
141
+ targetBoard := ctx . TargetBoard
142
142
require .Equal (t , "mega" , targetBoard .BoardId )
143
143
require .Equal (t , "atmega2560" , targetBoard .Properties [constants .BUILD_PROPERTIES_BUILD_MCU ])
144
144
require .Equal (t , "AVR_MEGA2560" , targetBoard .Properties [constants .BUILD_PROPERTIES_BUILD_BOARD ])
@@ -161,11 +161,11 @@ func TestTargetBoardResolverCustomYun(t *testing.T) {
161
161
NoError (t , err )
162
162
}
163
163
164
- targetPackage := context [ constants . CTX_TARGET_PACKAGE ].( * types. Package )
164
+ targetPackage := ctx . TargetPackage
165
165
require .Equal (t , "my_avr_platform" , targetPackage .PackageId )
166
- targetPlatform := context [ constants . CTX_TARGET_PLATFORM ].( * types. Platform )
166
+ targetPlatform := ctx . TargetPlatform
167
167
require .Equal (t , "avr" , targetPlatform .PlatformId )
168
- targetBoard := context [ constants . CTX_TARGET_BOARD ].( * types. Board )
168
+ targetBoard := ctx . TargetBoard
169
169
require .Equal (t , "custom_yun" , targetBoard .BoardId )
170
170
require .Equal (t , "atmega32u4" , targetBoard .Properties [constants .BUILD_PROPERTIES_BUILD_MCU ])
171
171
require .Equal (t , "AVR_YUN" , targetBoard .Properties [constants .BUILD_PROPERTIES_BUILD_BOARD ])
@@ -188,11 +188,11 @@ func TestTargetBoardResolverCustomCore(t *testing.T) {
188
188
NoError (t , err )
189
189
}
190
190
191
- targetPackage := context [ constants . CTX_TARGET_PACKAGE ].( * types. Package )
191
+ targetPackage := ctx . TargetPackage
192
192
require .Equal (t , "watterott" , targetPackage .PackageId )
193
- targetPlatform := context [ constants . CTX_TARGET_PLATFORM ].( * types. Platform )
193
+ targetPlatform := ctx . TargetPlatform
194
194
require .Equal (t , "avr" , targetPlatform .PlatformId )
195
- targetBoard := context [ constants . CTX_TARGET_BOARD ].( * types. Board )
195
+ targetBoard := ctx . TargetBoard
196
196
require .Equal (t , "attiny841" , targetBoard .BoardId )
197
197
require .Equal (t , "tiny841" , context [constants .CTX_BUILD_CORE ].(string ))
198
198
require .Equal (t , "tiny14" , targetBoard .Properties [constants .BUILD_PROPERTIES_BUILD_VARIANT ])
0 commit comments