diff options
| author | Furkan Sahin <furkan-dev@proton.me> | 2021-09-05 01:00:12 -0500 |
|---|---|---|
| committer | Furkan Sahin <furkan-dev@proton.me> | 2021-09-05 01:00:12 -0500 |
| commit | c356d233bab7b4bb6cc29c1c03abadf111b40d0e (patch) | |
| tree | fcc6b9b633ed826e3996fba7d9b806ea7bd69d2c /adapters/gtest/config.go | |
| parent | d4f9c927e0efad402e1dbfded1a850fb9e0030e6 (diff) | |
Remove pointers and cleanup templating, add version info
Diffstat (limited to 'adapters/gtest/config.go')
| -rw-r--r-- | adapters/gtest/config.go | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/adapters/gtest/config.go b/adapters/gtest/config.go index 4cd2030..b8a196b 100644 --- a/adapters/gtest/config.go +++ b/adapters/gtest/config.go @@ -13,21 +13,21 @@ const ( ) type Defaults struct { - Name *string - Suite *string - Testfile *string + Name string + Suite string + Testfile string Srcs []string - Timeout *uint + Timeout uint } func (child *Defaults) Inherit(p interface{}) { parent := p.(*Defaults) - if(child.Name == nil) { child.Name = parent.Name } - if(child.Suite == nil) { child.Suite = parent.Suite } - if(child.Testfile == nil) { child.Testfile = parent.Testfile } + if(child.Name == "") { child.Name = parent.Name } + if(child.Suite == "") { child.Suite = parent.Suite } + if(child.Testfile == "") { child.Testfile = parent.Testfile } if(len(child.Srcs) == 0) { child.Srcs = parent.Srcs } - if(child.Timeout == nil) { child.Timeout = parent.Timeout } + if(child.Timeout == 0) { child.Timeout = parent.Timeout } } @@ -36,17 +36,16 @@ type Config struct { } func (c * Config) finalize(path string) { - if c.Name == nil { + if c.Name == "" { log.Fatalf("\"name\" is not defined for unit: %s\n", path) - } else if c.Suite == nil { + } else if c.Suite == "" { log.Fatalf("\"suite\" is not defined for unit: %s\n", path) - } else if c.Testfile == nil { + } else if c.Testfile == "" { log.Fatalf("\"testfile\" is not defined for unit: %s\n", path) } - if c.Timeout == nil { - c.Timeout = new(uint) - *c.Timeout = DEFAULT_TIMEOUT; + if c.Timeout == 0 { + c.Timeout = DEFAULT_TIMEOUT; } } |
