Ejemplo n.º 1
0
        public void Delta_RandomBaseline <TInputStream, TOutputStream>() where TInputStream : NetworkCompression.IInputStream, new()
            where TOutputStream : NetworkCompression.IOutputStream, new()
        {
            var random = new System.Random(12091);

            for (int i = 0; i < 1024; ++i)
            {
                var schema         = NetworkTestUtils.GenerateRandomSchema(64, random.Next());
                var values         = NetworkTestUtils.GenerateRandomValues(schema, random.Next());
                var baselineValues = NetworkTestUtils.GenerateRandomValues(schema, random.Next());

                TestDelta <TInputStream, TOutputStream>(schema, values, baselineValues);
            }
        }
Ejemplo n.º 2
0
        public void NetworkReadWrite_TestRandomValues()
        {
            var random = new System.Random(192831);

            var buffer = new byte[1024 * 1024];

            for (int i = 0; i < 100; ++i)
            {
                var schema = NetworkTestUtils.GenerateRandomSchema(64, random.Next());
                var values = NetworkTestUtils.GenerateRandomValues(schema, random.Next());

                NetworkTestUtils.WriteValues(values, buffer, schema);
                NetworkTestUtils.ReadAndAssertValues(values, buffer, schema);
            }
        }