当前位置: 首页>>代码示例>>C#>>正文


C# AList.Resize方法代码示例

本文整理汇总了C#中AList.Resize方法的典型用法代码示例。如果您正苦于以下问题:C# AList.Resize方法的具体用法?C# AList.Resize怎么用?C# AList.Resize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AList的用法示例。


在下文中一共展示了AList.Resize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Loyc_Collections

		public static void Loyc_Collections()
		{
			MiniTest.RunTests.Run(new CPTrieTests());
			MiniTest.RunTests.Run(new SimpleCacheTests());
			MiniTest.RunTests.Run(new InvertibleSetTests());
			// Test with small node sizes as well as the standard node size,
			// including the minimum size of 3 (the most problematic size).
			int seed = 237588399;
			MiniTest.RunTests.Run(new AListTests(false, seed, 8, 8));
			MiniTest.RunTests.Run(new BListTests(false, seed, 3, 3));
			MiniTest.RunTests.Run(new BDictionaryTests(false, seed, 6, 6));
			MiniTest.RunTests.Run(new SparseAListTests(false, seed, 10, 10));
			MiniTest.RunTests.Run(new DequeTests<AList<int>>(delegate() { return new AList<int>(); }));
			MiniTest.RunTests.Run(new DequeTests<SparseAList<int>>(delegate() { return new SparseAList<int>(); }));
			MiniTest.RunTests.Run(new DictionaryTests<BDictionary<object, object>>(true, true));
			MiniTest.RunTests.Run(new ListTests<AList<int>>(false, delegate(int n) { var l = new AList<int>(); l.Resize(n); return l; }));
			MiniTest.RunTests.Run(new ListRangeTests<AList<int>>(false, delegate() { return new AList<int>(); }, 12345));
			MiniTest.RunTests.Run(new ListTests<SparseAList<int>>(false, delegate(int n) { var l = new SparseAList<int>(); l.Resize(n); return l; }, 12345));
			MiniTest.RunTests.Run(new ListRangeTests<SparseAList<int>>(false, delegate() { return new SparseAList<int>(); }, 12345));
			MiniTest.RunTests.Run(new RWListTests());
			MiniTest.RunTests.Run(new WListTests());
			MiniTest.RunTests.Run(new RVListTests());
			MiniTest.RunTests.Run(new VListTests());
			MiniTest.RunTests.Run(new MapTests());
			MiniTest.RunTests.Run(new SparseAListTests(true, seed, 8, 4));
			MiniTest.RunTests.Run(new SparseAListTests());
			MiniTest.RunTests.Run(new AListTests());
			MiniTest.RunTests.Run(new BListTests());
			MiniTest.RunTests.Run(new BDictionaryTests());
			MiniTest.RunTests.Run(new MSetTests()); // derived from MutableSetTests<MSet<STI>, STI>
			MiniTest.RunTests.Run(new SymbolSetTests()); // derived from MutableSetTests<MSet<Symbol>, Symbol>
			MiniTest.RunTests.Run(new ImmSetTests()); // tests for Set<T>
			MiniTest.RunTests.Run(new MapTests()); // derived from DictionaryTests<MMap<object, object>>
			MiniTest.RunTests.Run(new KeylessHashtableTests());
		}
开发者ID:jonathanvdc,项目名称:Loyc,代码行数:35,代码来源:Program.cs

示例2: Main

		public static void Main(string[] args)
		{
			// Workaround for MS bug: Assert(false) will not fire in debugger
			Debug.Listeners.Clear();
			Debug.Listeners.Add( new DefaultTraceListener() );

			Console.WriteLine("Running tests on stable code...");
			// Omitted: unit tests that throw & catch exceptions (those are below)

			// Loyc.Essentials
			RunTests.Run(new ListExtTests());
			RunTests.Run(new MathExTests());
			RunTests.Run(new UStringTests());
			RunTests.Run(new StringExtTests());
			RunTests.Run(new HashTagsTests());
			RunTests.Run(new LocalizeTests());
			RunTests.Run(new SymbolTests());
			RunTests.Run(new ThreadExTests());
			RunTests.Run(new ListTests<InternalList<int>>(false, delegate(int n) { var l = InternalList<int>.Empty; l.Resize(n); return l; }));
			RunTests.Run(new ListRangeTests<InternalList<int>>(false, delegate() { return InternalList<int>.Empty; }));
			RunTests.Run(new ListTests<DList<int>>(false, delegate(int n) { var l = new DList<int>(); l.Resize(n); return l; }));
			RunTests.Run(new DequeTests<DList<int>>(delegate() { return new DList<int>(); }));
			RunTests.Run(new ListRangeTests<DList<int>>(false, delegate() { return new DList<int>(); }));

			// Loyc.Collections
			RunTests.Run(new CPTrieTests());
			RunTests.Run(new SimpleCacheTests());
			RunTests.Run(new InvertibleSetTests());
			// Test with small node sizes as well as the standard node size,
			// including the minimum size of 3 (the most problematic size).
			int seed = 237588399;
			RunTests.Run(new AListTests(false, seed, 8, 8));
			RunTests.Run(new BListTests(false, seed, 3, 3));
			RunTests.Run(new BDictionaryTests(false, seed, 6, 6));
			RunTests.Run(new SparseAListTests(false, seed, 10, 10));
			RunTests.Run(new DequeTests<AList<int>>(delegate() { return new AList<int>(); }));
			RunTests.Run(new DequeTests<SparseAList<int>>(delegate() { return new SparseAList<int>(); }));
			RunTests.Run(new DictionaryTests<BDictionary<object, object>>(true, true));
			RunTests.Run(new ListTests<AList<int>>(false, delegate(int n) { var l = new AList<int>(); l.Resize(n); return l; }));
			RunTests.Run(new ListRangeTests<AList<int>>(false, delegate() { return new AList<int>(); }, 12345));
			RunTests.Run(new ListTests<SparseAList<int>>(false, delegate(int n) { var l = new SparseAList<int>(); l.Resize(n); return l; }, 12345));
			RunTests.Run(new ListRangeTests<SparseAList<int>>(false, delegate() { return new SparseAList<int>(); }, 12345));

			// Loyc.Syntax
			RunTests.Run(new TokenTests());
			RunTests.Run(new LesLexerTests());
			RunTests.Run(new LesParserTests());
			RunTests.Run(new LesPrinterTests());
			RunTests.Run(new TokensToTreeTests());
			RunTests.Run(new StreamCharSourceTests());
			RunTests.Run(new LexerSourceTests_Calculator());
			RunTests.Run(new ParserSourceTests_Calculator());
			RunTests.Run(new IndentTokenGeneratorTests());

			// Loyc.Utilities
			RunTests.Run(new LineMathTests());
			RunTests.Run(new PointMathTests());
			RunTests.Run(new Loyc.LLParserGenerator.IntSetTests());
			RunTests.Run(new TagsInWListTests());
			RunTests.Run(new UGTests());

			for(;;) {
				ConsoleKeyInfo k;

				Console.WriteLine();
				Console.WriteLine("What do you want to do?");
				Console.WriteLine("1. Run unit tests that expect exceptions");
				Console.WriteLine("2. Run unit tests on unstable code");
				Console.WriteLine("9. Benchmarks");
				Console.WriteLine("Z. List encodings");
				Console.WriteLine("Press ESC or ENTER to Quit");
				Console.WriteLine((k = Console.ReadKey(true)).KeyChar);
				if (k.Key == ConsoleKey.Escape || k.Key == ConsoleKey.Enter)
					break;
				else if (k.KeyChar == '1') {
					// Loyc.Essentials
					RunTests.Run(new GTests());
					
					// Loyc.Utilities
					RunTests.Run(new GoInterfaceTests());
					
					// Loyc.Collections
					RunTests.Run(new RWListTests()); 
					RunTests.Run(new WListTests());
					RunTests.Run(new RVListTests());
					RunTests.Run(new VListTests());
					RunTests.Run(new MapTests());
					RunTests.Run(new SparseAListTests(true, seed, 8, 4));
					RunTests.Run(new SparseAListTests());
					RunTests.Run(new AListTests());
					RunTests.Run(new BListTests());
					RunTests.Run(new BDictionaryTests());
					RunTests.Run(new MSetTests()); // derived from MutableSetTests<MSet<STI>, STI>
					RunTests.Run(new SymbolSetTests()); // derived from MutableSetTests<MSet<Symbol>, Symbol>
					RunTests.Run(new ImmSetTests()); // tests for Set<T>
					RunTests.Run(new MapTests()); // derived from DictionaryTests<MMap<object, object>>
				} else if (k.KeyChar == '2') {
					RunTests.Run(new KeylessHashtableTests());
				} else if (k.KeyChar == 'z' || k.KeyChar == 'Z') {
					foreach (EncodingInfo inf in Encoding.GetEncodings())
//.........这里部分代码省略.........
开发者ID:default0,项目名称:LoycCore,代码行数:101,代码来源:Program.cs


注:本文中的AList.Resize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。