public void CompareTestingObject(int in1, int in2, int exp) { var f161 = new Fixed <Q16_16>(in1); var f162 = new Fixed <Q16_16>(in2); Assert.Equal(exp, f161.CompareTo((object)f162)); var f241 = new Fixed <Q24_8>(in1); var f242 = new Fixed <Q24_8>(in2); Assert.Equal(exp, f241.CompareTo((object)f242)); var f81 = new Fixed <Q8_24>(in1); var f82 = new Fixed <Q8_24>(in2); Assert.Equal(exp, f81.CompareTo((object)f82)); try { Assert.Equal(exp, f81.CompareTo(5)); Assert.False(true); } catch { Assert.True(true); } }
public void CompareTesting(int in1, int in2, int exp) { var f161 = new Fixed <Q16_16>(in1); var f162 = new Fixed <Q16_16>(in2); Assert.Equal(exp, f161.CompareTo(f162)); var f241 = new Fixed <Q24_8>(in1); var f242 = new Fixed <Q24_8>(in2); Assert.Equal(exp, f241.CompareTo(f242)); var f81 = new Fixed <Q8_24>(in1); var f82 = new Fixed <Q8_24>(in2); Assert.Equal(exp, f81.CompareTo(f82)); }