summaryrefslogtreecommitdiff
path: root/adapters/gtest/config.go
diff options
context:
space:
mode:
Diffstat (limited to 'adapters/gtest/config.go')
-rw-r--r--adapters/gtest/config.go27
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;
}
}