[Mono-bugs] [Bug 573691] New: DataContractJsonSerializer bug with floating point special values

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Jan 25 16:07:43 EST 2010


http://bugzilla.novell.com/show_bug.cgi?id=573691

http://bugzilla.novell.com/show_bug.cgi?id=573691#c0


           Summary: DataContractJsonSerializer bug with floating point
                    special values
    Classification: Mono
           Product: Mono: Class Libraries
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: WCF
        AssignedTo: atsushi at ximian.com
        ReportedBy: spouliot at novell.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


Test cases (already in SVN).

        object ReadWriteObject (Type type, object obj, string expected)
        {
            using (MemoryStream ms = new MemoryStream ()) {
                DataContractJsonSerializer dcjs = new
DataContractJsonSerializer (type);
                dcjs.WriteObject (ms, obj);
                ms.Position = 0;
                using (StreamReader sr = new StreamReader (ms)) {
                    Assert.AreEqual (expected, sr.ReadToEnd (), "WriteObject");

                    ms.Position = 0;
                    return dcjs.ReadObject (ms);
                }
            }
        }

        [Test]
        [Category ("NotWorking")]
        public void ReadWriteObject_Single_SpecialCases ()
        {
            Assert.IsTrue (Single.IsNaN ((float) ReadWriteObject (typeof
(float), Single.NaN, "NaN")));
            Assert.IsTrue (Single.IsNegativeInfinity ((float) ReadWriteObject
(typeof (float), Single.NegativeInfinity, "-INF")));
            Assert.IsTrue (Single.IsPositiveInfinity ((float) ReadWriteObject
(typeof (float), Single.PositiveInfinity, "INF")));
        }

        [Test]
        [Category ("NotWorking")]
        public void ReadWriteObject_Double_SpecialCases ()
        {
            Assert.IsTrue (Double.IsNaN ((double) ReadWriteObject (typeof
(double), Double.NaN, "NaN")));
            Assert.IsTrue (Double.IsNegativeInfinity ((double) ReadWriteObject
(typeof (double), Double.NegativeInfinity, "-INF")));
            Assert.IsTrue (Double.IsPositiveInfinity ((double) ReadWriteObject
(typeof (double), Double.PositiveInfinity, "INF")));
        }

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list