Ejemplo n.º 1
0
 public static void RunFeature2()
 {
     if (MonoLinkerSupport.IsFeatureSupported(MonoLinkerFeature.Unknown))
     {
         TestHelpers.AssertFail("Feature `MonoLinkerFeature.Unknown` should be disabled.");
     }
 }
Ejemplo n.º 2
0
        ISimpleCollator GetCollator()
        {
            if (!MonoLinkerSupport.IsFeatureSupported(MonoLinkerFeature.Martin))
            {
                return(null);
            }

            if (collator != null)
            {
                return(collator);
            }

            if (collators == null)
            {
                Interlocked.CompareExchange(ref collators, new Dictionary <string, ISimpleCollator> (StringComparer.Ordinal), null);
            }

            TestHelpers.AssertRemoved();

            lock (collators) {
                if (!collators.TryGetValue(_sortName, out collator))
                {
                    collator = new SimpleCollator(CultureInfo.GetCultureInfo(m_name));
                    collators [_sortName] = collator;
                }
            }

            return(collator);
        }
Ejemplo n.º 3
0
        public static void RunFeature(MonoLinkerFeature feature)
        {
            bool supported;

            switch (feature)
            {
            case MonoLinkerFeature.Martin:
                supported = MonoLinkerSupport.IsFeatureSupported(MonoLinkerFeature.Martin);
                break;

            case MonoLinkerFeature.Unknown:
                supported = MonoLinkerSupport.IsFeatureSupported(MonoLinkerFeature.Unknown);
                break;

            case MonoLinkerFeature.ReflectionEmit:
                Console.Error.WriteLine("REFLECTION EMIT");
                supported = false;
                break;

            default:
                throw new AssertionException();
            }

            Console.WriteLine($"DONE: {supported}");
        }
Ejemplo n.º 4
0
 public static void RunFeature1()
 {
     if (!MonoLinkerSupport.IsFeatureSupported(MonoLinkerFeature.Martin))
     {
         TestHelpers.AssertFail("Feature `MonoLinkerFeature.Martin` should not be available.");
     }
 }
        public static void Main()
        {
            var supported = MonoLinkerSupport.IsFeatureSupported(MonoLinkerFeature.Martin) && ReturnTrue();

            if (supported)
            {
                Foo.Hello();
            }
        }
        static Object CreateInstanceImpl(Type type,
                                         BindingFlags bindingAttr, Binder binder,
                                         Object[] args,
                                         Object[] activationAttributes)
        {
            if ((object)type == null)
            {
                throw new ArgumentNullException("type");
            }
            if (MonoLinkerSupport.IsWeakInstanceOf <TypeBuilder> (type))
            {
                throw new NotSupportedException(MyEnvironment.GetResourceString("X"));
            }

            // If they didn't specify a lookup, then we will provide the default lookup.
            if ((bindingAttr & (BindingFlags)LookupMask) == 0)
            {
                bindingAttr |= TestConditionals.ConstructorDefault;
            }

            bool status = false;

            if (MonoLinkerSupport.IsFeatureSupported(MonoLinkerFeature.Martin))
            {
                status = true;
                if (activationAttributes != null && activationAttributes.Length > 0)
                {
                    if (type.IsMarshalByRef)
                    {
                        if (!(type.IsContextful))
                        {
                            if (activationAttributes.Length > 1 || !(activationAttributes[0] is UrlAttribute))
                            {
                                throw new NotSupportedException(MyEnvironment.GetResourceString("Y"));
                            }
                        }
                    }
                    else
                    {
                        throw new NotSupportedException(MyEnvironment.GetResourceString("Z"));
                    }
                }
            }

            TestHelpers.Assert(status);

            TypeInfo rt = type.UnderlyingSystemType as TypeInfo;

            if (rt == null)
            {
                throw new ArgumentException(MyEnvironment.GetResourceString("X"), "type");
            }

            return(Test(rt, bindingAttr, binder, args, activationAttributes));
        }
        public static void Main()
        {
            if (!MonoLinkerSupport.IsFeatureSupported(MonoLinkerFeature.Martin))
            {
                return;
            }

            lock (locker) {
                Hello();
            }
        }
Ejemplo n.º 8
0
 public static void RunFeature(bool test)
 {
     if (test)
     {
         return;
     }
     if (MonoLinkerSupport.IsFeatureSupported(MonoLinkerFeature.Martin))
     {
         throw new AssertionException("Feature `MonoLinkerFeature.Martin` should be disabled.");
     }
 }
        public static void Main()
        {
            var supported = MonoLinkerSupport.IsFeatureSupported(MonoLinkerFeature.Martin) && ReturnTrue();

            Console.Error.WriteLine($"SUPPORTED: {supported}");

            if (supported)
            {
                Foo.Hello();
            }
        }
Ejemplo n.º 10
0
 public static void RunFeature()
 {
     if (!MonoLinkerSupport.IsFeatureSupported(MonoLinkerFeature.Martin))
     {
         throw new InvalidOperationException("Expected `MonoLinkerFeature.Martin` to be enabled.");
     }
     if (MonoLinkerSupport.IsFeatureSupported(MonoLinkerFeature.Unknown))
     {
         throw new InvalidOperationException("Expected `MonoLinkerFeature.Unknown` to be disabled.");
     }
 }
Ejemplo n.º 11
0
        public static void RunFeature()
        {
            bool supported;

            try {
                supported = MonoLinkerSupport.IsFeatureSupported(MonoLinkerFeature.Martin);
                if (supported)
                {
                    throw new AssertionException("Feature `MonoLinkerFeature.Martin` should not be enabled.");
                }
            } catch (Exception ex) {
                Console.Error.WriteLine($"ERROR: {ex.Message}");
                throw;
            }

            Console.WriteLine($"DONE: {supported}");
        }
Ejemplo n.º 12
0
 public static bool RunFeature3()
 {
     return(MonoLinkerSupport.IsFeatureSupported(MonoLinkerFeature.Martin));
 }
Ejemplo n.º 13
0
 public static bool RunFeature2()
 {
     return(MonoLinkerSupport.IsFeatureSupported(MonoLinkerFeature.Unknown));
 }