@@ -386,44 +386,44 @@ func TestUpdateLogSources_ErrorCases(t *testing.T) {
386386}
387387
388388func TestUpdateLogSources_ReturnsLowercaseProviderFields (t * testing.T ) {
389- // Mixed-case input on purpose.
390- userCfg := LogSourcesInfo {
391- LogConfig : LogConfig {
392- Sources : []Source {
393- {
394- Type : "ETW" ,
395- Providers : []EtwProvider {
396- {
397- ProviderName : "Microsoft.Windows.HyperV.Compute" ,
398- },
399- {
400- ProviderName : "Some.Mixed.Case.Provider" ,
401- ProviderGUID : "{6F9619FF-8B86-D011-B42D-00C04FC964FF}" ,
402- },
403- },
404- },
405- },
406- },
407- }
408-
409- encoded := mustEncodeLogSources (t , userCfg )
410-
411- // useDefaultLogSources=false keeps assertion focused on this input only.
412- got , err := UpdateLogSources (encoded , false , true )
413- if err != nil {
414- t .Fatalf ("UpdateLogSources returned unexpected error: %v" , err )
415- }
416-
417- decoded := mustDecodeLogSources (t , got )
418-
419- for si , src := range decoded .LogConfig .Sources {
420- for pi , p := range src .Providers {
421- if p .ProviderName != "" && p .ProviderName != strings .ToLower (p .ProviderName ) {
422- t .Fatalf ("providerName is not lowercase at source[%d].providers[%d]: %q" , si , pi , p .ProviderName )
423- }
424- if p .ProviderGUID != "" && p .ProviderGUID != strings .ToLower (p .ProviderGUID ) {
425- t .Fatalf ("providerGuid is not lowercase at source[%d].providers[%d]: %q" , si , pi , p .ProviderGUID )
426- }
427- }
428- }
389+ // Mixed-case input on purpose.
390+ userCfg := LogSourcesInfo {
391+ LogConfig : LogConfig {
392+ Sources : []Source {
393+ {
394+ Type : "ETW" ,
395+ Providers : []EtwProvider {
396+ {
397+ ProviderName : "Microsoft.Windows.HyperV.Compute" ,
398+ },
399+ {
400+ ProviderName : "Some.Mixed.Case.Provider" ,
401+ ProviderGUID : "{6F9619FF-8B86-D011-B42D-00C04FC964FF}" ,
402+ },
403+ },
404+ },
405+ },
406+ },
407+ }
408+
409+ encoded := mustEncodeLogSources (t , userCfg )
410+
411+ // useDefaultLogSources=false keeps assertion focused on this input only.
412+ got , err := UpdateLogSources (encoded , false , true )
413+ if err != nil {
414+ t .Fatalf ("UpdateLogSources returned unexpected error: %v" , err )
415+ }
416+
417+ decoded := mustDecodeLogSources (t , got )
418+
419+ for si , src := range decoded .LogConfig .Sources {
420+ for pi , p := range src .Providers {
421+ if p .ProviderName != "" && p .ProviderName != strings .ToLower (p .ProviderName ) {
422+ t .Fatalf ("providerName is not lowercase at source[%d].providers[%d]: %q" , si , pi , p .ProviderName )
423+ }
424+ if p .ProviderGUID != "" && p .ProviderGUID != strings .ToLower (p .ProviderGUID ) {
425+ t .Fatalf ("providerGuid is not lowercase at source[%d].providers[%d]: %q" , si , pi , p .ProviderGUID )
426+ }
427+ }
428+ }
429429}
0 commit comments