Merge pull request #821 from travisturner/container-thaw-v21

remove container thaw in test; use repair instead
This commit is contained in:
Travis Turner 2020-10-05 12:23:27 -05:00 committed by GitHub
commit 5e79e224f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 4 deletions

View file

@ -4617,8 +4617,8 @@ func compareArrayArray(a1, a2 []uint16) error {
// an error describing any difference it finds. This is mostly intended
// for use in tests that expect equality.
func (c *Container) BitwiseCompare(c2 *Container) error {
if c.N() != c2.N() {
return errors.New("containers are different lengths")
if cn, c2n := c.N(), c2.N(); cn != c2n {
return errors.Errorf("containers are different lengths: %d, %d", cn, c2n)
}
if c.N() == 0 {
return nil

View file

@ -4391,12 +4391,18 @@ func TestUnionRunRunInPlaceBitwiseCompare(t *testing.T) {
for _, a := range runs {
for _, b := range runs {
t.Run(a.name+"-"+b.name, func(t *testing.T) {
arun := doContainer(containerRun, a.run).Thaw()
brun := doContainer(containerRun, b.run).Thaw()
arun := doContainer(containerRun, a.run)
brun := doContainer(containerRun, b.run)
out1 := unionBitmapRunInPlace(arun.runToBitmap(), brun)
out2 := unionRunRunInPlace(arun, brun)
// Because these containers have been modified using in-place
// methods, we need to repair them before comparison to ensure
// that their `n` value is updated.
out1.Repair()
out2.Repair()
err := out1.BitwiseCompare(out2.runToBitmap())
if err != nil {
t.Fatal(err)