From: Darx K. <dar...@gm...> - 2007-07-29 10:33:35
|
Hi The HowTo is really great and I am glad we have it finally. :D There is only one thing that should be changed and that is the Test Case Example. The AOT already does some basic constant folding that means that when it finds something like 1+2 then it computes that so the if statement becomes if (3 == 3). Other optimizations will come later and the whole code can be reduced to "return 1;". So it would be great if the CMP method calls another one that does the test and CMP only compares the result and returns 1 or 0. Something like this: public unsafe static uint Misc2 (uint granularity) { switch (granularity) { case 0: return 4096; case 1: return 131072; default: return 0xFFFFFFFF; } } public unsafe static uint CMPMisc2a () { if (Misc2 (0) == 4096) return 1; return 0; } That way there will be no such optimizations and the test will be more reliable. Chriss. Bruce wrote: > Hey Ya'll: > > Because the AOT is very massive, a few of us are in agreement that the > AOT needs to be tested as thoroughly as possible. > > I have posted, on the Wiki, a short guide to writing tests for the > AOT: > http://sharpos.sourceforge.net/cgi-bin/trac.cgi/wiki/HowTo%3A%20AOT%20Unit%20Testing > <I%20have%20posted,%20on%20the%20Wiki,%20a%20short%20guide%20to%20writing%20tests%20for%20the%20AOT:%20http://sharpos.sourceforge.net/cgi-bin/trac.cgi/wiki/HowTo%253A%2520AOT%2520Unit%2520Testing> > > The guide does not go into detail as to the granularity of tests, or > the necessity of any particular tests or types of tests - just simply > how a test is written. It can be expanded either by the rest of you > folks, or as suggestions are made I will maintain the article myself. > > -Bruce > aka Illuminus > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > ------------------------------------------------------------------------ > > _______________________________________________ > SharpOS-Developers mailing list > Sha...@li... > https://lists.sourceforge.net/lists/listinfo/sharpos-developers > |