Values assigned to map properties were silently ignored instead of
reported as an error. Add a check when recursing into structs that
the value is a map.
Fixes: 177706602
Test: m nothing
Test: TestUnpackErrors
Change-Id: Ic56aeb1b9da6d5c86b6d98adae7bddb60c450404
Add more tests, give the tests names, run them as subtests, and add
benchmarks.
Test: unpack_test.go
Change-Id: Iff22538ce44ed503d5d088cfb55673448db998f1
Soong config variables may propagate an uppercase name from Make.
Blueprint properties have traditionally been all lowercase, and
using an uppercase property struct field name resulted in a strange
Blueprint property name with the first rune lowercase and the
remaining runes uppercase.
Update the rules for proptools.PropertyNameForField to not lowercase
the first rune if the field name has mulitple runes and is not all
uppercase.
Fixes: 148865218
Test: proptools_test.go
Change-Id: I8de2f65ffb00e5a8ce0aea0caf09f5859315f6b8
The proptools functions took an inconsistent variety of
struct and *struct types. Some methods even took a struct
but returned a *struct. Make all the exported methods
take a *struct, with internal helpers for the ones that need
to take a struct.
Test: proptools tests
Change-Id: I60ce212606e96adcef66c531d57f69c39e1a1638
The filter tag is unused, replaced with FilterPropertyStruct to
generate a new type at runtime that only contains the filtered
fields.
Test: unpack_test.go
Change-Id: Id91cf99290832094d05426f3263279836f0fea73