[Groonga-commit] groonga/grnci at aa1ad19 [master] Add a test of DB.ThreadLimit.

Back to archive index

Susumu Yata null+****@clear*****
Wed Sep 13 13:45:24 JST 2017


Susumu Yata	2017-09-13 13:45:24 +0900 (Wed, 13 Sep 2017)

  New Revision: aa1ad19355925a5c753801392aba9f6ff8dcd4ea
  https://github.com/groonga/grnci/commit/aa1ad19355925a5c753801392aba9f6ff8dcd4ea

  Message:
    Add a test of DB.ThreadLimit.
    
    Ref: #39

  Modified files:
    v2/libgrn/db_test.go

  Modified: v2/libgrn/db_test.go (+23 -0)
===================================================================
--- v2/libgrn/db_test.go    2017-09-13 13:39:26 +0900 (662225c)
+++ v2/libgrn/db_test.go    2017-09-13 13:45:24 +0900 (bd73775)
@@ -1029,6 +1029,29 @@ func TestDBTableTokenizeWithOptions(t *testing.T) {
 	}
 }
 
+func TestDBThreadLimit(t *testing.T) {
+	db, dir := makeDB(t)
+	defer removeDB(db, dir)
+
+	n, err := db.ThreadLimit(2)
+	if err != nil {
+		t.Fatalf("db.ThreadLimit failed: %v", err)
+	}
+	if n == 0 {
+		t.Skipf("This client does not support thread_limit")
+	}
+	if want := 1; n != want {
+		t.Fatalf("db.ThreadLimit failed: n = %d, want = %d", n, want)
+	}
+	n, err = db.ThreadLimit(-1)
+	if err != nil {
+		t.Fatalf("db.ThreadLimit failed: %v", err)
+	}
+	if want := 2; n != want {
+		t.Fatalf("db.ThreadLimit failed: n = %d, want = %d", n, want)
+	}
+}
+
 func TestDBTokenize(t *testing.T) {
 	db, dir := makeDB(t)
 	defer removeDB(db, dir)
-------------- next part --------------
HTML����������������������������...
URL: https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20170913/47ef26af/attachment.htm 



More information about the Groonga-commit mailing list
Back to archive index