|
| 1 | +// Copyright 2021 Matrix Origin |
| 2 | +// |
| 3 | +// Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +// you may not use this file except in compliance with the License. |
| 5 | +// You may obtain a copy of the License at |
| 6 | +// |
| 7 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +// |
| 9 | +// Unless required by applicable law or agreed to in writing, software |
| 10 | +// distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +// See the License for the specific language governing permissions and |
| 13 | +// limitations under the License. |
| 14 | + |
| 15 | +package top |
| 16 | + |
| 17 | +import ( |
| 18 | + "testing" |
| 19 | + |
| 20 | + "github.com/matrixorigin/matrixone/pkg/container/batch" |
| 21 | + "github.com/matrixorigin/matrixone/pkg/testutil" |
| 22 | + "github.com/matrixorigin/matrixone/pkg/vm/process" |
| 23 | +) |
| 24 | + |
| 25 | +func Test_container_reset(t *testing.T) { |
| 26 | + bat := batch.New([]string{"id"}) |
| 27 | + bat.Vecs[0] = testutil.MakeInt32Vector([]int32{1, 2, 3}, nil) |
| 28 | + buildBat := batch.New([]string{"id"}) |
| 29 | + buildBat.Vecs[0] = testutil.MakeInt32Vector([]int32{1, 2, 3}, nil) |
| 30 | + |
| 31 | + proc := &process.Process{ |
| 32 | + Base: &process.BaseProcess{}, |
| 33 | + } |
| 34 | + proc.SetMPool(testutil.TestUtilMp) |
| 35 | + |
| 36 | + c := &container{ |
| 37 | + n: 0, |
| 38 | + state: 0, |
| 39 | + sels: nil, |
| 40 | + poses: nil, |
| 41 | + cmps: nil, |
| 42 | + limit: 0, |
| 43 | + limitExecutor: nil, |
| 44 | + executorsForOrderColumn: nil, |
| 45 | + desc: false, |
| 46 | + topValueZM: nil, |
| 47 | + bat: bat, |
| 48 | + buildBat: buildBat, |
| 49 | + } |
| 50 | + c.reset(proc) |
| 51 | +} |
0 commit comments