Commit 8a39cbcb authored by wangwx's avatar wangwx

fix comments

parent 89232d38
...@@ -15,6 +15,7 @@ See the License for the specific language governing permissions and ...@@ -15,6 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
//refs:https://github.com/golang/go/blob/2333c6299f340a5f76a73a4fec6db23ffa388e97/src/sync/poolqueue.go
package gxqueue package gxqueue
import ( import (
......
...@@ -15,16 +15,20 @@ See the License for the specific language governing permissions and ...@@ -15,16 +15,20 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
//refs:https://github.com/golang/go/blob/2333c6299f340a5f76a73a4fec6db23ffa388e97/src/sync/pool_test.go
package gxqueue package gxqueue
import ( import (
"github.com/stretchr/testify/assert"
"runtime" "runtime"
"sync" "sync"
"sync/atomic" "sync/atomic"
"testing" "testing"
) )
import (
"github.com/stretchr/testify/assert"
)
func TestCreatePoolDequeue(t *testing.T) { func TestCreatePoolDequeue(t *testing.T) {
_, err := NewPoolDequeue(15) _, err := NewPoolDequeue(15)
assert.EqualError(t, err, "the size of pool must be a power of 2") assert.EqualError(t, err, "the size of pool must be a power of 2")
...@@ -35,6 +39,7 @@ func TestCreatePoolDequeue(t *testing.T) { ...@@ -35,6 +39,7 @@ func TestCreatePoolDequeue(t *testing.T) {
_, err = NewPoolDequeue(8) _, err = NewPoolDequeue(8)
assert.NoError(t, err) assert.NoError(t, err)
} }
func TestPoolDequeue(t *testing.T) { func TestPoolDequeue(t *testing.T) {
const P = 10 const P = 10
var N int = 2e6 var N int = 2e6
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment