Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/14/10 21:23:51 (15 years ago)
Author:
epitzer
Message:

correct and speed-up serialization for number enumerables (#548)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Persistence/3.3/Tests/UseCases.cs

    r3742 r3811  
    10411041      }
    10421042    }
     1043
     1044    [TestMethod]
     1045    public void TestSpecialNumbers() {
     1046      List<double> specials = new List<double>() { 1.0 / 0, -1.0 / 0, 0.0 / 0 };
     1047      Assert.IsTrue(double.IsPositiveInfinity(specials[0]));
     1048      Assert.IsTrue(double.IsNegativeInfinity(specials[1]));
     1049      Assert.IsTrue(double.IsNaN(specials[2]));
     1050      XmlGenerator.Serialize(specials, tempFile);
     1051      List<double> newSpecials = XmlParser.Deserialize<List<double>>(tempFile);
     1052      Assert.IsTrue(double.IsPositiveInfinity(newSpecials[0]));
     1053      Assert.IsTrue(double.IsNegativeInfinity(newSpecials[1]));
     1054      Assert.IsTrue(double.IsNaN(newSpecials[2]));
     1055    }
    10431056   
    10441057
Note: See TracChangeset for help on using the changeset viewer.