Esempio n. 1
0
        public void BlockTest(bool expectedTestResult, double expectedTValue, double check, string binaryText)
        {
            (bool testResult, double tValue) = GolombTests.BlockTest(binaryText, check);
            tValue = Math.Round(tValue, 3);

            Assert.Equal(expectedTValue, tValue);
            Assert.Equal(expectedTestResult, testResult);
        }
Esempio n. 2
0
        private static void TestGolomb()
        {
            CheckConstants checks = new CheckConstants()
            {
                Check1 = 3.841458820694124,
                Check2 = 5.991464547107979,
                Check4 = 9.487729036781154,
                Check5 = 1.959963984540054
            };
            string text = "01001001011001110110111101110010011010010111001101100010011001010110110001101111011101100110000101110011";

            Console.WriteLine($"T1: {GolombTests.SingleBitTest(text, checks.Check1)}");
            Console.WriteLine($"T2: {GolombTests.PairBitTest(text, checks.Check2)}");
            Console.WriteLine($"T4: {GolombTests.BlockTest(text, checks.Check4)}");
        }