pike.git / src / testsuite.in

version» Context lines:

pike.git/src/testsuite.in:5646:    X x1 = X(1.0), x2 = X(1.0);    multiset m = (<x1, X(2.0), X(3.0)>);    m[x2] = 1;    add_constant ("cnt");    return ({(m[x1] = 1, sizeof (m)),    (m[x2] = 1, sizeof (m)),    (m[X(0.5)] = 1, sizeof (m))});   ]], [[({4, 4, 5})]])      test_do(add_constant("cnt");) -  +    test_eq([[sizeof(mtest_m2)]],sizeof(mtest_i2)) -  +  + test_any([[ +  // Test subtraction of multisets of objects. +  class X(int a) +  { +  protected int `<(mixed o) { return objectp(o) && (a < o->a); } +  protected int `==(mixed o) { return objectp(o) && (a == o->a); } +  }; +  multiset m = (< @map(allocate(5), X) >); +  return sizeof(m - (<0>)); + ]], 5) +    test_any([[int e;multiset q=(<>),p=(<>); for(e=0;e<1000;e++) { p[reverse(e)]=1; q+=(<reverse(e)>); if(!equal(sort(indices(p)),sort(indices(q)))) return 0; } return 1;]],1)      test_equal(sort(indices(mtest_m|mtest_m2)),sort(mtest_i|mtest_i2))   test_equal(sort(indices(mtest_m&mtest_m2)),sort(mtest_i&mtest_i2))   test_equal(sort(indices(mtest_m-mtest_m2)),sort(mtest_i-mtest_i2))   test_equal(sort(indices(mtest_m^mtest_m2)),sort(mtest_i^mtest_i2))   test_equal(sort(indices(mtest_m2|mtest_m)),sort(mtest_i2|mtest_i))   test_equal(sort(indices(mtest_m2&mtest_m)),sort(mtest_i2&mtest_i))   test_equal(sort(indices(mtest_m2-mtest_m)),sort(mtest_i2-mtest_i))   test_equal(sort(indices(mtest_m2^mtest_m)),sort(mtest_i2^mtest_i))