Пример #1
0
        internal static IEnumerable <string> GetSkipTraits(IEnumerable <string> additionalFilters = null)
        {
            yield return($"{DeviceType}={DeviceTypes.ToExclude}");

            yield return($"{InteractionType}={InteractionTypes.ToExclude}");

            yield return($"{UI}={FeatureSupport.ToExclude(false)}");

            yield return($"{Hardware.Accelerometer}={FeatureSupport.ToExclude(HardwareSupport.HasAccelerometer)}");

            yield return($"{Hardware.Compass}={FeatureSupport.ToExclude(HardwareSupport.HasCompass)}");

            yield return($"{Hardware.Gyroscope}={FeatureSupport.ToExclude(HardwareSupport.HasGyroscope)}");

            yield return($"{Hardware.Magnetometer}={FeatureSupport.ToExclude(HardwareSupport.HasMagnetometer)}");

            yield return($"{Hardware.Battery}={FeatureSupport.ToExclude(HardwareSupport.HasBattery)}");

            yield return($"{Hardware.Flash}={FeatureSupport.ToExclude(HardwareSupport.HasFlash)}");

            if (additionalFilters != null)
            {
                foreach (var filter in additionalFilters)
                {
                    yield return(filter);
                }
            }
        }
Пример #2
0
        public MainWindow()
        {
            var sgxfeature = new FeatureSupport();

            InitializeComponent();

            // In the SGX branch, the lock timeout is also stored in our password vault.
            _mgr.set_lock_timeout((ushort)_prefs.LockDelay);

            // Detect SGX support
            if (sgxfeature.is_supported() == 1)
            {
                // We support SGX, but are we enabled or is further action required?
                if (sgxfeature.is_enabled() == 1)
                {
                    _mgr.set_sgx_support();
                }
                else if (sgxfeature.reboot_required() == 1)
                {
                    MessageBox.Show("Intel­® SGX is supported on this system, but a reboot is required to enable it. This application will run without Intel® SGX support for now.", "Intel® SGX not enabled");
                }
                else if (sgxfeature.bios_enable_required() == 1)
                {
                    MessageBox.Show("Intel® SGX is supported on this system, but it needs to be manually enabled in the BIOS. This application will run without Intel® SGX for now.", "Intel® SGX not enabled");
                }
            }
        }
Пример #3
0
        static void Main(string[] args)
        {
            TestSetup      setup      = new TestSetup();
            FeatureSupport sgxfeature = new FeatureSupport();
            TestSuite      tests;

            setup.setSGXSupport(sgxfeature.is_enabled() == 1);

            tests = new TestSuite(setup);
            Exit(tests.RunAll() ? 0 : 1);
        }
Пример #4
0
        public formMain()
        {
            sgxfeature = new FeatureSupport();
            setup      = new TestSetup();

            InitializeComponent();

            if (sgxfeature.is_enabled() == 1)
            {
                sGXCodeBranchMenuItem.Checked = true;
                sGXCodeBranchMenuItem.Enabled = true;
            }
            setup.setOutputCallback(outputResults);
        }
Пример #5
0
        internal static List <XUnitFilter> GetCommonTraits(params XUnitFilter[] additionalFilters)
        {
            var filters = new List <XUnitFilter>
            {
                new XUnitFilter(DeviceType, DeviceTypes.ToExclude, true),
                new XUnitFilter(InteractionType, InteractionTypes.ToExclude, true),
                new XUnitFilter(Hardware.Accelerometer, FeatureSupport.ToExclude(HardwareSupport.HasAccelerometer), true),
                new XUnitFilter(Hardware.Compass, FeatureSupport.ToExclude(HardwareSupport.HasCompass), true),
                new XUnitFilter(Hardware.Gyroscope, FeatureSupport.ToExclude(HardwareSupport.HasGyroscope), true),
                new XUnitFilter(Hardware.Magnetometer, FeatureSupport.ToExclude(HardwareSupport.HasMagnetometer), true),
                new XUnitFilter(Hardware.Battery, FeatureSupport.ToExclude(HardwareSupport.HasBattery), true),
                new XUnitFilter(Hardware.Flash, FeatureSupport.ToExclude(HardwareSupport.HasFlash), true),
            };

            if (additionalFilters != null && additionalFilters.Any())
            {
                filters.AddRange(additionalFilters);
            }

            return(filters);
        }
Пример #6
0
 public void GivenIGoToTheMainPageOfBingSite()
 {
     BingMainPage = new FeatureSupport().GoToBingMainPage();
 }
 public void FeatureSupport_IsPresent_NonStaticField_ThrowsTargetException(Type featureClassType, string featureConstName)
 {
     Assert.Throws <TargetException>(() => FeatureSupport.IsPresent(featureClassType.AssemblyQualifiedName, featureConstName));
     Assert.Throws <TargetException>(() => FeatureSupport.IsPresent(featureClassType.AssemblyQualifiedName, featureConstName, new Version(1, 2, 3, 4)));
 }
 public void FeatureSupport_IsPresent_InvokeCustomMinimumVersionClassName_ReturnsExpected(string featureClassName, string featureConstName, Version minimumVersion, bool expected)
 {
     Assert.Equal(expected, FeatureSupport.IsPresent(featureClassName, featureConstName, minimumVersion));
 }
 public void FeatureSupport_GetVersionPresent_Invoke_ReturnsExpected(string featureClassName, string featureConstName, Version expected)
 {
     Assert.Equal(expected, FeatureSupport.GetVersionPresent(featureClassName, featureConstName));
 }
Пример #10
0
 public IApduCommand GetApdu(FeatureSupport featureSupport) =>
 GenerateApdu(new[] { (byte)featureSupport }, (byte)ApplicationTag.ReaderInformation,
              (byte)OperationTag.Set, (byte)ConfigurationSectionTag.CommonContactlessConfiguration, 0xA0,
              0x91);
Пример #11
0
 protected override void ReadBody(BinaryReader reader)
 {
     reader.ReadBytes(3);
     FeatureSupport = (FeatureSupport)reader.ReadByte();
 }