Skip to content

Commit

Permalink
Clean and simplify some code (#279)
Browse files Browse the repository at this point in the history
* Clean and simplify some code

Signed-off-by: JmPotato <ghzpotato@gmail.com>

* Remove unused Makefile content

Signed-off-by: JmPotato <ghzpotato@gmail.com>
  • Loading branch information
JmPotato committed May 23, 2021
1 parent 90fdc8d commit 685b13a
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ BRANCH=`git rev-parse --abbrev-ref HEAD`
COMMIT=`git rev-parse --short HEAD`
GOLDFLAGS="-X main.branch $(BRANCH) -X main.commit $(COMMIT)"

default: build

race:
@TEST_FREELIST_TYPE=hashmap go test -v -race -test.run="TestSimulate_(100op|1000op)"
@echo "array freelist test"
Expand Down
2 changes: 1 addition & 1 deletion db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ func TestOpen_FileTooSmall(t *testing.T) {
t.Fatal(err)
}

db, err = bolt.Open(path, 0666, nil)
_, err = bolt.Open(path, 0666, nil)
if err == nil || err.Error() != "file size too small" {
t.Fatalf("unexpected error: %s", err)
}
Expand Down
3 changes: 1 addition & 2 deletions tx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ func TestTx_Check_ReadOnly(t *testing.T) {
numChecks := 2
errc := make(chan error, numChecks)
check := func() {
err, _ := <-tx.Check()
errc <- err
errc <- <-tx.Check()
}
// Ensure the freelist is not reloaded and does not race.
for i := 0; i < numChecks; i++ {
Expand Down

0 comments on commit 685b13a

Please sign in to comment.