mirror of
				https://github.com/go-gitea/gitea
				synced 2025-11-03 21:08:25 +00:00 
			
		
		
		
	Fix test case
This commit is contained in:
		@@ -7,7 +7,7 @@ package captcha
 | 
				
			|||||||
import (
 | 
					import (
 | 
				
			||||||
	"testing"
 | 
						"testing"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/astaxie/beego/utils"
 | 
						"github.com/gogits/gogs/modules/base"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
type byteCounter struct {
 | 
					type byteCounter struct {
 | 
				
			||||||
@@ -21,7 +21,7 @@ func (bc *byteCounter) Write(b []byte) (int, error) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
func BenchmarkNewImage(b *testing.B) {
 | 
					func BenchmarkNewImage(b *testing.B) {
 | 
				
			||||||
	b.StopTimer()
 | 
						b.StopTimer()
 | 
				
			||||||
	d := utils.RandomCreateBytes(challengeNums, defaultChars...)
 | 
						d := base.RandomCreateBytes(challengeNums, defaultChars...)
 | 
				
			||||||
	b.StartTimer()
 | 
						b.StartTimer()
 | 
				
			||||||
	for i := 0; i < b.N; i++ {
 | 
						for i := 0; i < b.N; i++ {
 | 
				
			||||||
		NewImage(d, stdWidth, stdHeight)
 | 
							NewImage(d, stdWidth, stdHeight)
 | 
				
			||||||
@@ -30,7 +30,7 @@ func BenchmarkNewImage(b *testing.B) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
func BenchmarkImageWriteTo(b *testing.B) {
 | 
					func BenchmarkImageWriteTo(b *testing.B) {
 | 
				
			||||||
	b.StopTimer()
 | 
						b.StopTimer()
 | 
				
			||||||
	d := utils.RandomCreateBytes(challengeNums, defaultChars...)
 | 
						d := base.RandomCreateBytes(challengeNums, defaultChars...)
 | 
				
			||||||
	b.StartTimer()
 | 
						b.StartTimer()
 | 
				
			||||||
	counter := &byteCounter{}
 | 
						counter := &byteCounter{}
 | 
				
			||||||
	for i := 0; i < b.N; i++ {
 | 
						for i := 0; i < b.N; i++ {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user