| Conditions | 4 |
| Total Lines | 20 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | package entropychecker |
||
| 34 | func TestFailure(t *testing.T) { |
||
| 35 | // Make sure we get a an error if we time out |
||
| 36 | Timeout = 200 * time.Millisecond |
||
| 37 | MinimumEntropy = 100000 |
||
| 38 | err := WaitForEntropy() |
||
| 39 | if err == nil { |
||
| 40 | t.Error("Should get error when timeout waited too long") |
||
| 41 | } |
||
| 42 | |||
| 43 | // Make sure an unspported OS returns an error (instead of unkown behavior) |
||
| 44 | supportedOS = "unknown" |
||
| 45 | Timeout = 10 * time.Second |
||
| 46 | MinimumEntropy = 128 |
||
| 47 | _, err = GetEntropy() |
||
| 48 | if err == nil { |
||
| 49 | t.Error("Should get error when using unknown OS") |
||
| 50 | } |
||
| 51 | err = WaitForEntropy() |
||
| 52 | if err == nil { |
||
| 53 | t.Error("Should get error when using unknown OS") |
||
| 54 | } |
||
| 57 |