mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 12:45:47 +00:00
spelling: debug, assert...
This commit is contained in:
1 parent
ceda3cfac4
commit
857def02cc
21 files changed
+41
-41
No files matched your search
@@ -1633,7 +1633,7 @@ function __cmdletization_BindCommonParameters
|
||||
methodName = "FilterByMaxPropertyValue";
|
||||
break;
|
||||
default:
|
||||
Dbg.Assert(false, "Unrecognize query xml element");
|
||||
Dbg.Assert(false, "Unrecognized query xml element");
|
||||
methodName = "NotAValidMethod";
|
||||
break;
|
||||
}
|
||||
|
||||
+1
-1
@@ -362,7 +362,7 @@ namespace Microsoft.PowerShell.Commands.Internal.Format
|
||||
}
|
||||
else
|
||||
{
|
||||
Diagnostics.Assert(false, "unknonw shape: this should never happen unless a new shape is added");
|
||||
Diagnostics.Assert(false, "unknown shape: this should never happen unless a new shape is added");
|
||||
return null;
|
||||
}
|
||||
return GetView(expressionFactory, db, t, typeNames, viewName);
|
||||
|
||||
@@ -5722,7 +5722,7 @@ if($paths) {
|
||||
Diagnostics.Assert((object)pair.Value.HelpFileName == (object)other.HelpFileName, "Pre-generated Provider help file incorrect");
|
||||
Diagnostics.Assert(pair.Value.ImplementingType == other.ImplementingType, "Pre-generated Provider implementing type incorrect");
|
||||
Diagnostics.Assert(string.Equals(pair.Value.Name, other.Name, StringComparison.Ordinal), "Pre-generated Provider name incorrect");
|
||||
Diagnostics.Assert(pair.Value.PSSnapIn == other.PSSnapIn, "Pre-generated Provider snappin type incorrect");
|
||||
Diagnostics.Assert(pair.Value.PSSnapIn == other.PSSnapIn, "Pre-generated Provider snapin type incorrect");
|
||||
Diagnostics.Assert(pair.Value.Module == other.Module, "Pre-generated Provider module incorrect");
|
||||
Diagnostics.Assert(pair.Value.Visibility == other.Visibility, "Pre-generated Provider visibility incorrect");
|
||||
}
|
||||
@@ -5741,7 +5741,7 @@ if($paths) {
|
||||
Diagnostics.Assert((object)pair.Value.HelpFileName == (object)other.HelpFileName, "Pre-generated Provider help file incorrect");
|
||||
Diagnostics.Assert(pair.Value.ImplementingType == other.ImplementingType, "Pre-generated Provider implementing type incorrect");
|
||||
Diagnostics.Assert(string.Equals(pair.Value.Name, other.Name, StringComparison.Ordinal), "Pre-generated Provider name incorrect");
|
||||
Diagnostics.Assert(pair.Value.PSSnapIn == other.PSSnapIn, "Pre-generated Provider snappin type incorrect");
|
||||
Diagnostics.Assert(pair.Value.PSSnapIn == other.PSSnapIn, "Pre-generated Provider snapin type incorrect");
|
||||
Diagnostics.Assert(pair.Value.Module == other.Module, "Pre-generated Provider module incorrect");
|
||||
Diagnostics.Assert(pair.Value.Visibility == other.Visibility, "Pre-generated Provider visibility incorrect");
|
||||
}
|
||||
|
||||
@@ -334,7 +334,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
// get the matched member(s)
|
||||
ReadOnlyPSMemberInfoCollection<PSMemberInfo> members =
|
||||
_inputObject.Members.Match(_propertyOrMethodName, PSMemberTypes.All);
|
||||
Dbg.Assert(members != null, "The retrun value of Members.Match shoudl never be null");
|
||||
Dbg.Assert(members != null, "The return value of Members.Match should never be null");
|
||||
|
||||
if (members.Count > 1)
|
||||
{
|
||||
|
||||
@@ -4532,7 +4532,7 @@ namespace System.Management.Automation
|
||||
delegateOwner = PSObject.AsPSObject(delegateOwner);
|
||||
foreach (CollectionEntry<T> collection in Collections)
|
||||
{
|
||||
Diagnostics.Assert(delegateOwner != null, "all integrating collections with non emtpty collections have an associated PSObject");
|
||||
Diagnostics.Assert(delegateOwner != null, "all integrating collections with non empty collections have an associated PSObject");
|
||||
T memberAsT = collection.GetMember((PSObject)delegateOwner, name);
|
||||
if (memberAsT != null)
|
||||
{
|
||||
|
||||
@@ -1405,7 +1405,7 @@ namespace System.Management.Automation
|
||||
/// </param>
|
||||
internal void Start(Process process, NativeCommandIOFormat inputFormat)
|
||||
{
|
||||
Dbg.Assert(process != null, "caller should validate the paramter");
|
||||
Dbg.Assert(process != null, "caller should validate the parameter");
|
||||
|
||||
//Get the encoding for writing to native command. Note we get the Encoding
|
||||
//from the current scope so a script or function can use a different encoding
|
||||
|
||||
@@ -358,7 +358,7 @@ namespace System.Management.Automation.Runspaces
|
||||
void
|
||||
SetMergeSettingsOnCommandProcessor(CommandProcessorBase commandProcessor)
|
||||
{
|
||||
Dbg.Assert(commandProcessor != null, "caller should valiadate the parameter");
|
||||
Dbg.Assert(commandProcessor != null, "caller should validate the parameter");
|
||||
|
||||
MshCommandRuntime mcr = commandProcessor.Command.commandRuntime as MshCommandRuntime;
|
||||
|
||||
@@ -477,8 +477,8 @@ namespace System.Management.Automation.Runspaces
|
||||
break;
|
||||
default:
|
||||
// This should never happen...
|
||||
Diagnostics.Assert(false, "Invalid langage mode was set when building a ScriptCommandProcessor");
|
||||
throw new InvalidOperationException("Invalid langage mode was set when building a ScriptCommandProcessor");
|
||||
Diagnostics.Assert(false, "Invalid language mode was set when building a ScriptCommandProcessor");
|
||||
throw new InvalidOperationException("Invalid language mode was set when building a ScriptCommandProcessor");
|
||||
}
|
||||
|
||||
if (scriptBlock.UsesCmdletBinding)
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace System.Management.Automation.Language
|
||||
{
|
||||
static CharExtensions()
|
||||
{
|
||||
Diagnostics.Assert(s_traits.Length == 128, "Extention methods rely on this table size.");
|
||||
Diagnostics.Assert(s_traits.Length == 128, "Extension methods rely on this table size.");
|
||||
}
|
||||
|
||||
private static readonly CharTraits[] s_traits = new CharTraits[]
|
||||
|
||||
@@ -10698,7 +10698,7 @@ namespace System.Management.Automation.Language
|
||||
return ExtractUsingVariableImpl(memberExpr.Expression);
|
||||
}
|
||||
|
||||
Diagnostics.Assert(false, "We should alwasy be able to get a VariableExpressionAst from a UsingExpressionAst");
|
||||
Diagnostics.Assert(false, "We should always be able to get a VariableExpressionAst from a UsingExpressionAst");
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -246,7 +246,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
|
||||
default:
|
||||
{
|
||||
Dbg.Assert(false, "Missing paramenter set in switch statement");
|
||||
Dbg.Assert(false, "Missing parameter set in switch statement");
|
||||
remoteRunspaces = new List<RemoteRunspace>(); // added to avoid prefast warning
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1098,7 +1098,7 @@ namespace System.Management.Automation.Remoting
|
||||
internal PSObject DeserializeToPSObject(Stream serializedDataStream)
|
||||
{
|
||||
Dbg.Assert(null != serializedDataStream, "Cannot Deserialize null data");
|
||||
Dbg.Assert(serializedDataStream.Length != 0, "Cannot Deserialze empty data");
|
||||
Dbg.Assert(serializedDataStream.Length != 0, "Cannot Deserialize empty data");
|
||||
|
||||
object result = null;
|
||||
using (XmlReader xmlReader = XmlReader.Create(serializedDataStream, InternalDeserializer.XmlReaderSettingsForCliXml))
|
||||
|
||||
@@ -692,7 +692,7 @@ namespace System.Management.Automation.Remoting
|
||||
runspacepoolInitData.Serialize(stream, fragmentor);
|
||||
stream.Exit();
|
||||
byte[] outbuffer = stream.Read();
|
||||
Dbg.Assert(outbuffer != null, "connet response data should be serialized");
|
||||
Dbg.Assert(outbuffer != null, "connect response data should be serialized");
|
||||
stream.Dispose();
|
||||
//we are done
|
||||
connectResponseData = outbuffer;
|
||||
|
||||
+2
-2
@@ -457,7 +457,7 @@ namespace System.Management.Automation.Remoting
|
||||
throw PSTraceSource.NewArgumentNullException("fsmEventArg");
|
||||
}
|
||||
|
||||
Dbg.Assert(_state == RemoteSessionState.NegotiationSent, "State must be NeogtiationReceived");
|
||||
Dbg.Assert(_state == RemoteSessionState.NegotiationSent, "State must be NegotiationReceived");
|
||||
Dbg.Assert(fsmEventArg.StateEvent == RemoteSessionEvent.NegotiationCompleted, "StateEvent must be NegotiationCompleted");
|
||||
|
||||
if (fsmEventArg.StateEvent != RemoteSessionEvent.NegotiationCompleted)
|
||||
@@ -921,7 +921,7 @@ namespace System.Management.Automation.Remoting
|
||||
//***TODO*** Deal with this on the client side. Key exchange packets should have additional information
|
||||
//that identify the context of negotiation. Just like callId in SetMax and SetMinRunspaces messages
|
||||
Dbg.Assert(_state >= RemoteSessionState.Established,
|
||||
"Key Receving can only be raised after reaching the Established state");
|
||||
"Key Receiving can only be raised after reaching the Established state");
|
||||
|
||||
switch (eventArgs.StateEvent)
|
||||
{
|
||||
|
||||
@@ -714,7 +714,7 @@ namespace System.Management.Automation
|
||||
else
|
||||
{
|
||||
// If this assertion fires, the command name is determined incorrectly.
|
||||
Diagnostics.Assert(commandNameAst is CommandParameterAst, "Unxpected element not handled correctly.");
|
||||
Diagnostics.Assert(commandNameAst is CommandParameterAst, "Unexpected element not handled correctly.");
|
||||
commandName = commandNameAst.Extent.Text;
|
||||
}
|
||||
|
||||
@@ -739,7 +739,7 @@ namespace System.Management.Automation
|
||||
|
||||
// Process the contents of a splatted variable into the arguments for this
|
||||
// command. If the variable contains a hashtable, distribute the key/value pairs
|
||||
// If it's an enumberable, then distribute the values as $args and finally
|
||||
// If it's an enumerable, then distribute the values as $args and finally
|
||||
// if it's a scalar, then the effect is equivalent to $var
|
||||
object splattedValue = _context.GetVariableValue(variableAst.VariablePath);
|
||||
foreach (var splattedParameter in PipelineOps.Splat(splattedValue, variableAst.Extent))
|
||||
|
||||
@@ -1032,7 +1032,7 @@ namespace System.Management.Automation.Internal
|
||||
} // if (rsa != null...
|
||||
else
|
||||
{
|
||||
Dbg.Assert(false, "Session key not availble to encrypt secure string");
|
||||
Dbg.Assert(false, "Session key not available to encrypt secure string");
|
||||
}
|
||||
|
||||
return encryptedDataAsString;
|
||||
@@ -1392,7 +1392,7 @@ namespace System.Management.Automation.Internal
|
||||
/// <returns></returns>
|
||||
internal bool ImportEncryptedSessionKey(string encryptedSessionKey)
|
||||
{
|
||||
Dbg.Assert(!String.IsNullOrEmpty(encryptedSessionKey), "encrypted sessoin key passed in cannot be null");
|
||||
Dbg.Assert(!String.IsNullOrEmpty(encryptedSessionKey), "encrypted session key passed in cannot be null");
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user