diff options
author | Michael Steinert <[email protected]> | 2015-04-10 15:28:23 -0500 |
---|---|---|
committer | Michael Steinert <[email protected]> | 2015-04-10 15:28:23 -0500 |
commit | 8b3b6781b0882eb5493539bf7e521dd98ad1f626 (patch) | |
tree | 7fb75f24e3bd90cff397f1addbf92d88ff5b94d7 | |
parent | d5d607bc17c79b55a00a141e705422c2569e29cf (diff) |
Test some failure conditions
-rw-r--r-- | transaction_test.go | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/transaction_test.go b/transaction_test.go index c53667a..81714cc 100644 --- a/transaction_test.go +++ b/transaction_test.go @@ -274,3 +274,75 @@ func TestEnv(t *testing.T) { } runtime.GC() } + +func TestFailure_001(t *testing.T) { + tx := Transaction{} + _, err := tx.GetEnvList() + if err == nil { + t.Fatalf("getenvlist #expected an error") + } +} + +func TestFailure_002(t *testing.T) { + tx := Transaction{} + err := tx.PutEnv("") + if err == nil { + t.Fatalf("getenvlist #expected an error") + } +} + +func TestFailure_003(t *testing.T) { + tx := Transaction{} + err := tx.CloseSession(0) + if err == nil { + t.Fatalf("getenvlist #expected an error") + } +} + +func TestFailure_004(t *testing.T) { + tx := Transaction{} + err := tx.OpenSession(0) + if err == nil { + t.Fatalf("getenvlist #expected an error") + } +} + +func TestFailure_005(t *testing.T) { + tx := Transaction{} + err := tx.ChangeAuthTok(0) + if err == nil { + t.Fatalf("getenvlist #expected an error") + } +} + +func TestFailure_006(t *testing.T) { + tx := Transaction{} + err := tx.AcctMgmt(0) + if err == nil { + t.Fatalf("getenvlist #expected an error") + } +} + +func TestFailure_007(t *testing.T) { + tx := Transaction{} + err := tx.SetCred(0) + if err == nil { + t.Fatalf("getenvlist #expected an error") + } +} + +func TestFailure_008(t *testing.T) { + tx := Transaction{} + err := tx.SetItem(User, "test") + if err == nil { + t.Fatalf("getenvlist #expected an error") + } +} + +func TestFailure_009(t *testing.T) { + tx := Transaction{} + _, err := tx.GetItem(User) + if err == nil { + t.Fatalf("getenvlist #expected an error") + } +} |