Browse Source

refactor use defer

Xiang Li 12 years ago
parent
commit
52d5e05201
1 changed files with 1 additions and 2 deletions
  1. 1 2
      tests/functional/simple_snapshot_test.go

+ 1 - 2
tests/functional/simple_snapshot_test.go

@@ -19,6 +19,7 @@ func TestSimpleSnapshot(t *testing.T) {
 	if err != nil {
 	if err != nil {
 		t.Fatal("start process failed:" + err.Error())
 		t.Fatal("start process failed:" + err.Error())
 	}
 	}
+	defer process.Kill()
 
 
 	time.Sleep(time.Second)
 	time.Sleep(time.Second)
 
 
@@ -84,6 +85,4 @@ func TestSimpleSnapshot(t *testing.T) {
 	if snapshots[0].Name() != "0_1004.ss" {
 	if snapshots[0].Name() != "0_1004.ss" {
 		t.Fatal("wrong name of snapshot :[0_1004.ss/", snapshots[0].Name(), "]")
 		t.Fatal("wrong name of snapshot :[0_1004.ss/", snapshots[0].Name(), "]")
 	}
 	}
-
-	process.Kill()
 }
 }