diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2022-02-11 10:54:41 +0000 |
|---|---|---|
| committer | Aleksandr Nogikh <wp32pw@gmail.com> | 2022-02-25 18:57:42 +0100 |
| commit | 8219a518aefc8a87e16ffbec8cd06944a0160032 (patch) | |
| tree | d08b7981f73262c1664bcdd8a2eb2a1e2fc80d2d /tools | |
| parent | 8135420d02be9c03a0fec5391c3088c978872af6 (diff) | |
tools/syz-testbed: introduce BoolCell cell type
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/syz-testbed/stats.go | 2 | ||||
| -rw-r--r-- | tools/syz-testbed/table.go | 17 |
2 files changed, 18 insertions, 1 deletions
diff --git a/tools/syz-testbed/stats.go b/tools/syz-testbed/stats.go index 1ff4af4d0..0db75c45c 100644 --- a/tools/syz-testbed/stats.go +++ b/tools/syz-testbed/stats.go @@ -142,7 +142,7 @@ func (view StatView) GenerateBugTable() (*Table, error) { for _, bug := range summaries { for _, group := range view.Groups { if bug.found[group.Name] { - table.Set(bug.title, group.Name, "YES") + table.Set(bug.title, group.Name, NewBoolCell(true)) } } } diff --git a/tools/syz-testbed/table.go b/tools/syz-testbed/table.go index f8ead50fb..31312ac93 100644 --- a/tools/syz-testbed/table.go +++ b/tools/syz-testbed/table.go @@ -35,6 +35,10 @@ type RatioCell struct { TotalCount int } +type BoolCell struct { + Value bool +} + func NewValueCell(sample *stats.Sample) *ValueCell { return &ValueCell{Value: sample.Median(), Sample: sample} } @@ -55,6 +59,19 @@ func (c *RatioCell) String() string { return fmt.Sprintf("%d / %d", c.TrueCount, c.TotalCount) } +func NewBoolCell(value bool) *BoolCell { + return &BoolCell{ + Value: value, + } +} + +func (c *BoolCell) String() string { + if c.Value { + return "YES" + } + return "NO" +} + func NewTable(topLeft string, columns ...string) *Table { return &Table{ TopLeftHeader: topLeft, |
