本文整理汇总了C#中Boolean.GetLength方法的典型用法代码示例。如果您正苦于以下问题:C# Boolean.GetLength方法的具体用法?C# Boolean.GetLength怎么用?C# Boolean.GetLength使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Boolean
的用法示例。
在下文中一共展示了Boolean.GetLength方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: runTest
public Boolean runTest()
{
Console.Error.WriteLine(s_strTFPath + " " + s_strTFName + " , for " + s_strClassMethod + " , Source ver " + s_strDtTmVer);
int iCountErrors = 0;
int iCountTestcases = 0;
String strLoc = "Loc_000oo";
String strBaseLoc;
short[] in2Arr = new Int16[10];
int[] in4Arr = new Int32[5];
long[] in8Arr = new Int64[0];
String[] strArr = new String[6];
Boolean[] boArr = new Boolean[3];
Double[] dblArr = new Double[2];
Single[] snglArr = new Single[32000];
Char[] chArr = new Char[10000];
int rank;
try {
LABEL_860_GENERAL:
do
{
strLoc = "Loc_819yt";
rank = -1;
in2Arr = new Int16[5];
iCountTestcases++;
try {
in2Arr.GetLength(rank);
iCountErrors++;
Console.WriteLine( s_strTFAbbrev+ "Err_499ws! , GetLength=="+in2Arr.Length);
} catch (IndexOutOfRangeException ioorExc) {}
catch (Exception exc) {
iCountErrors++;
Console.WriteLine( s_strTFAbbrev+ "Err_758! exc=="+exc);
}
strLoc = "Loc_819ee";
rank = 1;
in2Arr = new Int16[5];
iCountTestcases++;
try {
in2Arr.GetLength(rank);
iCountErrors++;
Console.WriteLine( s_strTFAbbrev+ "Err_500ws! , GetLength=="+in2Arr.Length);
} catch (IndexOutOfRangeException ioorExc) {}
catch (Exception exc) {
iCountErrors++;
Console.WriteLine( s_strTFAbbrev+ "Err_750! exc=="+exc);
}
strLoc = "Loc_482wu";
rank = 0;
in2Arr = new Int16[10];
iCountTestcases++;
if(in2Arr.GetLength(rank) != 10)
{
iCountErrors++;
Console.WriteLine( s_strTFAbbrev+ "Err_481ua! , GetLength=="+in2Arr.Length);
}
strLoc = "Loc_471ay";
in4Arr = new Int32[5];
iCountTestcases++;
if(in4Arr.GetLength(rank) != 5)
{
iCountErrors++;
Console.WriteLine( s_strTFAbbrev+ "Err_29qaq! , GetLength=="+in4Arr.Length);
}
strLoc = "Loc_982uq";
in8Arr = new Int64[0];
iCountTestcases++;
if(in8Arr.GetLength(rank) != 0)
{
iCountErrors++;
Console.WriteLine( s_strTFAbbrev+ "Err_237sy! , GetLength=="+in8Arr.Length);
}
strLoc = "Loc_172ms";
boArr = new Boolean[3];
iCountTestcases++;
if(boArr.GetLength(rank) != 3)
{
iCountErrors++;
Console.WriteLine( s_strTFAbbrev+ "Err_382! , GetLength=="+boArr.Length);
}
strLoc = "Loc_49su";
dblArr = new Double[2];
iCountTestcases++;
if(dblArr.GetLength(rank) != 2)
{
iCountErrors++;
Console.WriteLine( s_strTFAbbrev+ "Err_200su! , GetLength=="+dblArr.Length);
}
strLoc = "Loc_371su";
snglArr = new Single[32000];
iCountTestcases++;
if(snglArr.GetLength(rank) != 32000)
{
iCountErrors++;
Console.WriteLine( s_strTFAbbrev+ "Err_319aw! , GetLength=="+snglArr.Length);
}
strLoc = "Loc_129wi";
strArr = new String[5];
strArr[2] = null;
iCountTestcases++;
if(strArr.GetLength(rank) != 5)
//.........这里部分代码省略.........