218 references to Assert
mscorlib (218)
microsoft\win32\registry.cs (3)
149BCLDebug.Assert(basekey != null, "basekey can't be null."); 174BCLDebug.Assert(basekey != null, "basekey can't be null!"); 176BCLDebug.Assert(key != null, "An exception should be thrown if failed!");
microsoft\win32\registrykey.cs (40)
408BCLDebug.Assert(false, "Unexpected code path in RegistryKey::CreateSubKey"); 630BCLDebug.Assert(index >= 0 && index < hkeyNames.Length, "index is out of range!"); 631BCLDebug.Assert((((int)hKey) & 0xFFFFFFF0) == 0x80000000, "Invalid hkey value!"); 1222BCLDebug.Assert(false, "[InternalGetValue] RegQueryValue returned ERROR_SUCCESS but gave a negative datasize"); 1243BCLDebug.Assert(datasize==8, "datasize==8"); 1257BCLDebug.Assert(datasize==4, "datasize==4"); 1361BCLDebug.Assert(blob[nextNull] == (char)0, "blob[nextNull] should be 0"); 1717BCLDebug.Assert(name!=null,"[FixupName]name!=null"); 1855BCLDebug.Assert(checkMode == RegistryKeyPermissionCheck.Default, "Should be called from a key opened under default mode only!"); 1856BCLDebug.Assert(subKeyWritable == false, "subKeyWritable should be false (unused)"); 1857BCLDebug.Assert(subKeyCheck == RegistryKeyPermissionCheck.Default, "subKeyCheck should be Default (unused)"); 1867BCLDebug.Assert(checkMode != RegistryKeyPermissionCheck.ReadSubTree, "We shouldn't allow creating sub key under read-only key!"); 1868BCLDebug.Assert(subKeyWritable == false, "subKeyWritable should be false (unused)"); 1869BCLDebug.Assert(subKeyCheck == RegistryKeyPermissionCheck.Default, "subKeyCheck should be Default (unused)"); 1881BCLDebug.Assert(checkMode != RegistryKeyPermissionCheck.ReadSubTree, "We shouldn't allow creating sub key under read-only key!"); 1882BCLDebug.Assert(subKeyWritable == false, "subKeyWritable should be false (unused)"); 1883BCLDebug.Assert(subKeyCheck == RegistryKeyPermissionCheck.Default, "subKeyCheck should be Default (unused)"); 1898BCLDebug.Assert(subKeyWritable == false, "subKeyWritable should be false (unused)"); 1899BCLDebug.Assert(subKeyCheck == RegistryKeyPermissionCheck.Default, "subKeyCheck should be Default (unused)"); 1911BCLDebug.Assert(checkMode != RegistryKeyPermissionCheck.ReadSubTree, "We shouldn't allow writing value to read-only key!"); 1912BCLDebug.Assert(subKeyWritable == false, "subKeyWritable should be false (unused)"); 1913BCLDebug.Assert(subKeyCheck == RegistryKeyPermissionCheck.Default, "subKeyCheck should be Default (unused)"); 1925BCLDebug.Assert(subKeyWritable == false, "subKeyWritable should be false (unused)"); 1926BCLDebug.Assert(subKeyCheck == RegistryKeyPermissionCheck.Default, "subKeyCheck should be Default (unused)"); 1937BCLDebug.Assert(subKeyWritable == false, "subKeyWritable should be false (unused)"); 1938BCLDebug.Assert(subKeyCheck == RegistryKeyPermissionCheck.Default, "subKeyCheck should be Default (unused)"); 1950BCLDebug.Assert(checkMode != RegistryKeyPermissionCheck.ReadSubTree, "We shouldn't allow writing value to read-only key!"); 1951BCLDebug.Assert(subKeyWritable == false, "subKeyWritable should be false (unused)"); 1952BCLDebug.Assert(subKeyCheck == RegistryKeyPermissionCheck.Default, "subKeyCheck should be Default (unused)"); 1965BCLDebug.Assert(checkMode != RegistryKeyPermissionCheck.ReadSubTree, "We shouldn't allow creating value under read-only key!"); 1966BCLDebug.Assert(subKeyWritable == false, "subKeyWritable should be false (unused)"); 1967BCLDebug.Assert(subKeyCheck == RegistryKeyPermissionCheck.Default, "subKeyCheck should be Default (unused)"); 1981BCLDebug.Assert(item == null, "CheckKeyReadPermission should never have a non-null item parameter!"); 1982BCLDebug.Assert(subKeyWritable == false, "subKeyWritable should be false (unused)"); 1983BCLDebug.Assert(subKeyCheck == RegistryKeyPermissionCheck.Default, "subKeyCheck should be Default (unused)"); 1994BCLDebug.Assert(subKeyWritable == false, "subKeyWritable should be false (unused)"); 2023BCLDebug.Assert(subKeyCheck == RegistryKeyPermissionCheck.Default, "subKeyCheck should be Default (unused)"); 2052BCLDebug.Assert(subKeyWritable == false, "subKeyWritable should be false (unused)"); 2067BCLDebug.Assert(false, "CheckPermission default switch case should never be hit!"); 2131BCLDebug.Assert(false, "unexpected code path");
microsoft\win32\win32native.cs (4)
534BCLDebug.Assert(buffer == null || (stringBytes >= 0 && (ulong)stringBytes <= buffer.ByteLength), 551BCLDebug.Assert((stringBytes == 0 && buffer == IntPtr.Zero) || (stringBytes > 0 && stringBytes <= UInt16.MaxValue && buffer != IntPtr.Zero), 835BCLDebug.Assert(hModule != IntPtr.Zero, "GetModuleHandle failed. Dll isn't loaded?"); 1311BCLDebug.Assert((0xFFFF0000 & errorCode) == 0, "This is an HRESULT, not an error code!");
system\appdomain.cs (5)
486BCLDebug.Assert(!RemotingServices.IsTransparentProxy(this), "QCalls should be made with the real AppDomain object rather than a transparent proxy"); 1110BCLDebug.Assert(_FusionStore.ApplicationTrust != null, "Expected to find runtime supplied ApplicationTrust"); 4164BCLDebug.Assert(propertyValues != null, "propertyValues != null"); 4165BCLDebug.Assert(propertyNames.Length == propertyValues.Length, "propertyNames.Length == propertyValues.Length"); 4188BCLDebug.Assert(false, "Unexpected default domain property");
system\bcldebug.cs (1)
190Assert(logLevel>=0 && logLevel<=10, "logLevel>=0 && logLevel<=10");
system\convert.cs (1)
2187BCLDebug.Assert(returnString.Length == j, "returnString.Length == j");
system\delegate.cs (1)
272BCLDebug.Assert(currentType != null || _target.GetType().IsCOMObject, "The class hierarchy should declare the method");
system\environment.cs (1)
1018if (r == IntPtr.Zero) BCLDebug.Assert(false, "SetEnvironmentVariable failed: " + Marshal.GetLastWin32Error());
system\globalization\datetimeformat.cs (1)
1064BCLDebug.Assert(val == 0, "DateTimeFormat.AppendNumber(): digits less than size of val");
system\reflection\assembly.cs (1)
3116BCLDebug.Assert((useLoadFile == false && throwOnFileNotFound == false) || dllNotFoundException != null,
system\rttype.cs (1)
449BCLDebug.Assert(true, "Invalid CacheType");
system\Runtime\InteropServices\ComEventsMethod.cs (1)
233BCLDebug.Assert(Empty == false, "event sink is executed but delegates list is empty");
system\Runtime\InteropServices\ComEventsSink.cs (4)
76BCLDebug.Assert(sinks != null, "removing event sink from empty sinks collection"); 77BCLDebug.Assert(sink != null, "specify event sink is null"); 259BCLDebug.Assert(_connectionPoint == null, "comevent sink is already advised"); 274BCLDebug.Assert(_connectionPoint != null, "can not unadvise from empty connection point");
system\Runtime\InteropServices\Variant.cs (43)
334BCLDebug.Assert(IsEmpty, "variant"); 363BCLDebug.Assert(IsEmpty, "variant"); // The setter can only be called once as VariantClear might be needed otherwise 376BCLDebug.Assert(VariantType == VarEnum.VT_I1, "variant"); 380BCLDebug.Assert(IsEmpty, "variant"); // The setter can only be called once as VariantClear might be needed otherwise 390BCLDebug.Assert(VariantType == VarEnum.VT_I2, "variant"); 394BCLDebug.Assert(IsEmpty, "variant"); // The setter can only be called once as VariantClear might be needed otherwise 404BCLDebug.Assert(VariantType == VarEnum.VT_I4, "variant"); 408BCLDebug.Assert(IsEmpty, "variant"); // The setter can only be called once as VariantClear might be needed otherwise 418BCLDebug.Assert(VariantType == VarEnum.VT_I8, "variant"); 422BCLDebug.Assert(IsEmpty, "variant"); // The setter can only be called once as VariantClear might be needed otherwise 432BCLDebug.Assert(VariantType == VarEnum.VT_UI1, "variant"); 436BCLDebug.Assert(IsEmpty, "variant"); // The setter can only be called once as VariantClear might be needed otherwise 446BCLDebug.Assert(VariantType == VarEnum.VT_UI2, "variant"); 450BCLDebug.Assert(IsEmpty, "variant"); // The setter can only be called once as VariantClear might be needed otherwise 460BCLDebug.Assert(VariantType == VarEnum.VT_UI4, "variant"); 464BCLDebug.Assert(IsEmpty, "variant"); // The setter can only be called once as VariantClear might be needed otherwise 474BCLDebug.Assert(VariantType == VarEnum.VT_UI8, "variant"); 478BCLDebug.Assert(IsEmpty, "variant"); // The setter can only be called once as VariantClear might be needed otherwise 488BCLDebug.Assert(VariantType == VarEnum.VT_INT, "variant"); 492BCLDebug.Assert(IsEmpty, "variant"); // The setter can only be called once as VariantClear might be needed otherwise 502BCLDebug.Assert(VariantType == VarEnum.VT_UINT, "variant"); 506BCLDebug.Assert(IsEmpty, "variant"); // The setter can only be called once as VariantClear might be needed otherwise 516BCLDebug.Assert(VariantType == VarEnum.VT_BOOL, "variant"); 520BCLDebug.Assert(IsEmpty, "variant"); // The setter can only be called once as VariantClear might be needed otherwise 530BCLDebug.Assert(VariantType == VarEnum.VT_ERROR, "variant"); 534BCLDebug.Assert(IsEmpty, "variant"); // The setter can only be called once as VariantClear might be needed otherwise 544BCLDebug.Assert(VariantType == VarEnum.VT_R4, "variant"); 548BCLDebug.Assert(IsEmpty, "variant"); // The setter can only be called once as VariantClear might be needed otherwise 558BCLDebug.Assert(VariantType == VarEnum.VT_R8, "variant"); 562BCLDebug.Assert(IsEmpty, "variant"); // The setter can only be called once as VariantClear might be needed otherwise 572BCLDebug.Assert(VariantType == VarEnum.VT_DECIMAL, "variant"); 579BCLDebug.Assert(IsEmpty, "variant"); // The setter can only be called once as VariantClear might be needed otherwise 591BCLDebug.Assert(VariantType == VarEnum.VT_CY, "variant"); 595BCLDebug.Assert(IsEmpty, "variant"); // The setter can only be called once as VariantClear might be needed otherwise 605BCLDebug.Assert(VariantType == VarEnum.VT_DATE, "variant"); 609BCLDebug.Assert(IsEmpty, "variant"); // The setter can only be called once as VariantClear might be needed otherwise 619BCLDebug.Assert(VariantType == VarEnum.VT_BSTR, "variant"); 623BCLDebug.Assert(IsEmpty, "variant"); // The setter can only be called once as VariantClear might be needed otherwise 633BCLDebug.Assert(VariantType == VarEnum.VT_UNKNOWN, "variant"); 639BCLDebug.Assert(IsEmpty, "variant"); // The setter can only be called once as VariantClear might be needed otherwise 652BCLDebug.Assert(VariantType == VarEnum.VT_DISPATCH, "variant"); 658BCLDebug.Assert(IsEmpty, "variant"); // The setter can only be called once as VariantClear might be needed otherwise 673BCLDebug.Assert(VariantType == (VarEnum.VT_BYREF | VarEnum.VT_VARIANT), "variant");
system\runtime\interopservices\windowsruntime\clripropertyvalueimpl.cs (2)
381BCLDebug.Assert((int)Type > 1024, "Unexpected array PropertyType value"); 478BCLDebug.Assert(false, "T in coersion function wasn't understood as a type that can be coerced - make sure that CoerceScalarValue and NumericScalarTypes are in sync");
system\runtime\interopservices\windowsruntime\clrireferenceimpl.cs (2)
26BCLDebug.Assert(obj != null, "Must not be null"); 105BCLDebug.Assert(obj != null, "Must not be null");
system\runtime\remoting\asyncresult.cs (1)
76BCLDebug.Assert(!_endInvokeCalled && value,
system\runtime\remoting\callcontext.cs (5)
343BCLDebug.Assert(false, "Security data should only be serialized in cross appdomain case."); 649BCLDebug.Assert(msg != null, "Why is the message null?"); 652BCLDebug.Assert(properties != null, "Why are the properties null?"); 685BCLDebug.Assert(msg != null, "Why is the message null?"); 700BCLDebug.Assert(properties != null, "Why are the properties null?");
system\runtime\remoting\crossappdomainchannel.cs (2)
331BCLDebug.Assert(remove == -1, "multiple sinks?"); 347BCLDebug.Assert(remove != -1, "Bad domainId for unload?");
system\runtime\remoting\crosscontextchannel.cs (3)
145BCLDebug.Assert(null != srvID,"null != srvID"); 148BCLDebug.Assert(null != srvID.ServerContext, "null != srvID.ServerContext"); 458BCLDebug.Assert(
system\runtime\remoting\identity.cs (9)
209BCLDebug.Assert(objURI!=null,"objURI should not be null here"); 264BCLDebug.Assert(IdentityHolder.TableLock.IsWriterLockHeld, "IDTable should be write-locked"); 289BCLDebug.Assert( 292BCLDebug.Assert( 306BCLDebug.Assert( 314BCLDebug.Assert( 322BCLDebug.Assert( 466BCLDebug.Assert(IdentityHolder.TableLock.IsWriterLockHeld, "IDTable should be write-locked"); 504BCLDebug.Assert(
system\runtime\remoting\leasemanager.cs (1)
72BCLDebug.Assert(leaseManager != null, "[LeaseManager.GetLeaseManager()]leaseManager !=null");
system\runtime\remoting\lifetimeservices.cs (1)
269BCLDebug.Assert(identity != null, "[LifetimeServices.GetObjectSink] identity != null");
system\runtime\remoting\objref.cs (11)
361BCLDebug.Assert(null != sinks, "null != sinks"); 437BCLDebug.Assert(o.GetType() == typeof(ObjRef), "this should be just an ObjRef"); 591BCLDebug.Assert(CanSmuggle(), "Caller should have made sure that CanSmuggle() was true first."); 728BCLDebug.Assert(null != uri, "null != uri"); 790BCLDebug.Assert((null != typeName) && (null != assemName), "non-null values expected"); 801BCLDebug.Assert(serverType!=null, "bad objRef!"); 872BCLDebug.Assert( 933BCLDebug.Assert(xadData != null, "bad objRef?"); 946BCLDebug.Assert(xadData != null, "bad objRef?"); 962BCLDebug.Assert(idObj != null,"idObj != null"); 969BCLDebug.Assert(null != obj, "Identity not setup correctly");
system\runtime\remoting\redirectionproxy.cs (2)
58BCLDebug.Assert(RemotingServices.IsTransparentProxy(obj), "expecting a proxy"); 108BCLDebug.Assert(serverType.IsCOMObject, "This must be a COM object type.");
system\runtime\remoting\remotingconfigparser.cs (4)
146BCLDebug.Assert(IsLeaseTimeSet == true, "LeaseTime not set"); 159BCLDebug.Assert(IsRenewOnCallTimeSet == true, "RenewOnCallTime not set"); 172BCLDebug.Assert(IsSponsorshipTimeoutSet == true, "SponsorShipTimeout not set"); 185BCLDebug.Assert(IsLeaseManagerPollTimeSet == true, "LeaseManagerPollTime not set");
system\runtime\remoting\remotingproxy.cs (8)
192BCLDebug.Assert( 331BCLDebug.Assert(!useDispatchMessage,"!useDispatchMessage"); 423BCLDebug.Assert(ar != null,"ar != null"); 424BCLDebug.Assert( (callType & Message.BeginAsync) != 0, 447BCLDebug.Assert(false, "How did we get here?"); 542BCLDebug.Assert( 651BCLDebug.Assert(null != IdentityObject,"null != IdentityObject"); 719BCLDebug.Assert(
system\runtime\remoting\remotingservices.cs (14)
1223BCLDebug.Assert(null != idObj,"null != idObj"); 1251BCLDebug.Assert(serverID.ServerType.IsMarshalByRef, 1282BCLDebug.Assert(IsTransparentProxy(obj), "Unexpected server"); 1342BCLDebug.Assert(ObjRef.IsWellFormed(idObj.ObjectRef), 1405BCLDebug.Assert( 1415BCLDebug.Assert(IsTransparentProxy(proxy),"IsTransparentProxy(proxy)"); 1470BCLDebug.Assert(null != proxy && IsTransparentProxy(proxy),"null != proxy && IsTransparentProxy(proxy)"); 1516BCLDebug.Assert(IsTransparentProxy(proxy),"IsTransparentProxy(proxy)"); 1523BCLDebug.Assert(null != realProxy,"null != realProxy"); 1559BCLDebug.Assert( 1650BCLDebug.Assert(null != url,"null != url"); 1663BCLDebug.Assert(null != url,"null != url"); 1691BCLDebug.Assert(null != idObj,"null != idObj"); 1733BCLDebug.Assert(rp != null, "Shouldn't be called with null real proxy.");
system\runtime\remoting\serveridentity.cs (6)
170BCLDebug.Assert( !IsSingleCall() && !IsSingleton(), "Bad serverID"); 176BCLDebug.Assert( !IsSingleCall() && !IsSingleton(), "Bad serverID"); 227BCLDebug.Assert( null != _serverObjectChain, 255BCLDebug.Assert(Thread.CurrentContext==_srvCtx, 312BCLDebug.Assert(null != rp, "null != rp"); 442BCLDebug.Assert(MarshalByRefObject.GetIdentity((MarshalByRefObject)this.TPOrObject) == this, "Server ID mismatch with Object");
system\runtime\remoting\stackbuildersink.cs (3)
78BCLDebug.Assert((server!=null) == (!_bStatic), 230BCLDebug.Assert((server!=null)==(!_bStatic), 481BCLDebug.Assert(messageCallContext != null, "message should always have a call context");
system\runtime\remoting\terminatorsinks.cs (8)
313BCLDebug.Assert(replyMsg is IConstructionReturnMessage,"bad ctorRetMsg"); 602BCLDebug.Assert(replyMsg is IConstructionReturnMessage,"bad ctorRetMsg"); 757BCLDebug.Assert(null != srvID,"null != srvID"); 772BCLDebug.Assert(null != _stackBuilderSink,"null != _stackBuilderSink"); 845BCLDebug.Assert(nextSink != null, 854BCLDebug.Assert(RemotingServices.CORProfilerTrackRemoting(), 856BCLDebug.Assert(RemotingServices.CORProfilerTrackRemotingAsync(), 884BCLDebug.Assert(false, "ClientAsyncReplyTerminatorSink.AsyncProcessMessage called!");
system\runtime\serialization\safeserializationmanager.cs (1)
422BCLDebug.Assert(previousType != null, "We should have at least one inheritance from the base type");
system\security\cryptography\cryptoconfig.cs (1)
589BCLDebug.Assert(machineNameHT != null, "machineNameHT != null");
system\security\cryptography\utils.cs (1)
1062BCLDebug.Assert(method != null, "method != null");
system\security\framesecuritydescriptor.cs (1)
155BCLDebug.Assert(AppDomain.CurrentDomain.IsLegacyCasPolicyEnabled, "Deny is only valid in legacy CAS mode");
system\security\permissions\fileiopermission.cs (1)
1094BCLDebug.Assert(
system\security\policy\appdomainevidencefactory.cs (1)
56BCLDebug.Assert(m_targetDomain == AppDomain.CurrentDomain, "AppDomainEvidenceFactory should not be used across domains.");
system\security\policy\applicationdirectorymembershipcondition.cs (1)
107BCLDebug.Assert( this.GetType().FullName.Equals( "System.Security.Policy.ApplicationDirectoryMembershipCondition" ), "Class name changed!" );
system\security\policy\applicationtrust.cs (2)
286BCLDebug.Assert(obj != null, "You need to pass in an object"); 308BCLDebug.Assert(elObject != null, "You need to pass in a security element");
system\security\policy\evidence.cs (5)
219BCLDebug.Assert(typeof(EvidenceBase).IsAssignableFrom(runtimeEvidenceType), "All runtime evidence types should be EvidenceBases"); 756BCLDebug.Assert(false, "Uknown DuplicateEvidenceAction"); 1275BCLDebug.Assert(cloneOrigin.Target != null && cloneOrigin.Target == Target, 1717BCLDebug.Assert(descriptor != null, "descriptor != null"); 1851BCLDebug.Assert(m_currentEvidence != null, "m_currentEvidence != null");
system\security\policy\hash.cs (2)
459BCLDebug.Assert(hashType == typeof(HashAlgorithm), "hashType == typeof(HashAlgorithm)"); 500BCLDebug.Assert(this.GetType().FullName.Equals("System.Security.Policy.Hash"), "Class name changed!");
system\security\policy\policystatement.cs (3)
216BCLDebug.Assert(HasDependentEvidence, "HasDependentEvidence"); 234BCLDebug.Assert(dependentEvidence != null, "dependentEvidence != null"); 250BCLDebug.Assert(childPolicy != null, "childPolicy != null");
system\security\policymanager.cs (3)
82BCLDebug.Assert(AppDomain.CurrentDomain.IsLegacyCasPolicyEnabled, "We're about to apply policy in a policy disabled app"); 234BCLDebug.Assert(membershipCondition != null, "membershipCondition != null"); 235BCLDebug.Assert(evidence != null, "evidence != null");
system\security\securitymanager.cs (2)
502BCLDebug.Assert(AppDomain.CurrentDomain.IsLegacyCasPolicyEnabled, "Evaluating assembly level declarative security without legacy CAS policy enabled"); 513BCLDebug.Assert(AppDomain.CurrentDomain.IsLegacyCasPolicyEnabled, "Evaluating assembly level declarative security without legacy CAS policy enabled");
system\sharedstatics.cs (1)
39BCLDebug.Assert(false, "SharedStatics..ctor() is never called.");
system\stubhelpers.cs (4)
46BCLDebug.Assert(cbLength > 0, "Zero bytes returned from DoAnsiConversion in AnsiCharMarshaler.ConvertToNative"); 398BCLDebug.Assert(nbytesused < nbytes, "Insufficient buffer allocated in VBByValStrMarshaler.ConvertToNative"); 1015BCLDebug.Assert(pvArrayMarshaler != IntPtr.Zero, "pvArrayMarshaler must not be null"); 1647BCLDebug.Assert(elem.m_owned == false, "m_owned is supposed to be false and set later by DangerousAddRef");