Пример #1
0
        public void TestGetDeltaScreen_via_WCF()
        {
#if DEBUG
            if (Directory.Exists(PipeScreenData.Framebufferpath) == false)
            {
                Assert.Inconclusive("Cannot find " + PipeScreenData.Framebufferpath);
                return;
            }

            List <string> FileList = Directory.EnumerateFiles(PipeScreenData.Framebufferpath, "*.png", SearchOption.TopDirectoryOnly).ToList();
            if (FileList == null || FileList.Count == 0)
            {
                Assert.Inconclusive("No PNG files in " + PipeScreenData.Framebufferpath);
                return;
            }

            ProgramAgent.Init();
            if (ProgramAgent.LoadDLLForced(SystemInfos.CPUType.EM64T) == false)
            {
                Assert.Inconclusive("Cannot load Agent supplemental DLL");
            }

            decimal sz = 0;
            decimal tz = 0;

            MainScreenSystem.Ping();

            for (int i = 0; i < FileList.Count; i++)
            {
                Stopwatch st = new Stopwatch();
                st.Start();
                byte[] d = MainScreenSystem.GetDeltaScreen2Debug();
                st.Stop();
                tz += st.ElapsedMilliseconds;
                sz += d.Length;
            }

            sz /= (decimal)FileList.Count;
            tz /= (decimal)FileList.Count;

            Console.WriteLine("Pictures: " + FileList.Count + " - AVG SZ=" + sz.ToString("0.00") + " bytes - AVG TZ= " + tz.ToString("0.0000") + " ms");
            Assert.AreEqual(0, 0);
#else
            Assert.Inconclusive("Unavalible in Release");
#endif
        }
Пример #2
0
        public void TestGetDeltaScreen()
        {
#if DEBUG
            if (Directory.Exists(PipeScreenData.Framebufferpath) == false)
            {
                Assert.Inconclusive("Cannot find " + PipeScreenData.Framebufferpath);
                return;
            }

            List <string> FileList = Directory.EnumerateFiles(PipeScreenData.Framebufferpath, "*.png", SearchOption.TopDirectoryOnly).ToList();
            if (FileList == null || FileList.Count == 0)
            {
                Assert.Inconclusive("No PNG files in " + PipeScreenData.Framebufferpath);
                return;
            }

            PipeScreenData psd = new PipeScreenData();
            decimal        sz  = 0;
            decimal        tz  = 0;

            for (int i = 0; i < FileList.Count; i++)
            {
                Stopwatch st = new Stopwatch();
                st.Start();
                PushScreenData s = psd.GetDeltaScreenDebug();
                byte[]         d = MainScreenSystem.ProcessPushScreenData(s);
                st.Stop();
                tz += st.ElapsedMilliseconds;
                sz += d.Length;
            }

            sz /= (decimal)FileList.Count;
            tz /= (decimal)FileList.Count;

            Console.WriteLine("Pictures: " + FileList.Count + " - AVG SZ=" + sz.ToString("0.00") + " bytes - AVG TZ= " + tz.ToString("0.0000") + " ms");
            Assert.AreEqual(0, 0);
#else
            Assert.Inconclusive("Unavalible in Release");
#endif
        }