diff options
author | Flu0r1ne <flur01ne@flu0r1ne.net> | 2021-09-05 01:00:12 -0500 |
---|---|---|
committer | Flu0r1ne <flur01ne@flu0r1ne.net> | 2021-09-05 01:00:12 -0500 |
commit | 4cc29e50d59daf445f4152d10f9f41cb1828f702 (patch) | |
tree | 2726dc5648c574213fdadf22349017be73690bd2 /adapters/gtest/config.go | |
parent | 151d516e68f5d43aa2d0c5ff462752d640b6a614 (diff) | |
download | deb-planr-4cc29e50d59daf445f4152d10f9f41cb1828f702.tar.xz deb-planr-4cc29e50d59daf445f4152d10f9f41cb1828f702.zip |
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 04d426c..533f266 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; } } |