aboutsummaryrefslogtreecommitdiffstats
path: root/mps/code/testlib.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Improve maintainability of complex loops.Gareth Rees2021-01-161-4/+3
| | | | | | | | | | | | | | 1. Avoid looping over two expressions in parallel when one makes more sense (compilers can do strength reduction optimization: we don't need to do it ourselves). 2. Introduce macro ITER_PARALLEL for iterating over two expressions in parallel, to clarify the intention and explain the need for the cast to void in the implementation. 3. Add macros SAC_LARGE_ITER and SAC_SMALL_ITER to reduce the amount of code duplication in sac.c.
* Ensure that the mps builds with "clang -werror -wcomma -std=c89".Gareth Rees2021-01-161-2/+2
| | | | | | | | | | The -Wcomma option appears to be turned on automatically by Xcode 12.3, so it's a good idea for the MPS to build with the option, to avoid unpleasant surprises when people update their Xcode. The simplest way to suppress the warning is to cast the left hand side of the comma operator to void.
* Ensure that the mps builds with clang 10.Gareth Rees2021-01-101-1/+1
| | | | | | | | | | | | | | | | Clang 10 turns on -Wimplicit-int-float-conversion, and on 64-bit platforms this issues a warning that implicit conversions to double from Size and unsigned long "may lose precision". This commit adds casts to (double) for all such conversions. The loss of precision is either impossible in practice (because a double can represent all integers up to 2**53, which is about 9 petabytes, well beyond the addressing capabilities for current CPUs), or else acceptable, because we are accumulating an approximate quantity like "collection work" or "fill size" (that has to cope with loss of precision due in any case), or computing a threshold like the spare commit limit where it is acceptable for it to be somewhat approximate.
* Fix indentation of second clause of license.Gareth Rees2020-08-301-3/+3
|
* Use https: instead of http: when linking to the ravenbrook web site.Gareth Rees2020-08-301-1/+1
|
* Publish licence updates in code directory.Peter Jackson2020-06-111-61/+49
| | | | | | | | | Publish minor changes to readme and configure files in main directory. Main directory and code directory licence texts are now fully updated. Copied from Perforce Change: 196994
* Fix issues identified in review by nb.Gareth Rees2018-06-141-0/+1
| | | | | | Copied from Perforce Change: 193793
* Avoid compilation errors from latest msvc.Gareth Rees2018-06-141-1/+0
| | | | | | Copied from Perforce Change: 193768
* Ensure that at most one collection of the world can be started in a call to ↵Gareth Rees2016-04-191-1/+10
| | | | | | | | | arenapoll. this avoids a loop if the live set is large enough to provoke the "dynamic criterion". Copied from Perforce Change: 191274 ServerID: perforce.ravenbrook.com
* Avoid "warning c4334: '<<' : result of 32-bit shift implicitly converted to ↵Gareth Rees2016-04-141-4/+4
| | | | | | | | | 64 bits (was 64-bit shift intended?)" from microsoft visual c. Copied from Perforce Change: 191138 ServerID: perforce.ravenbrook.com
* Documenting and checking constraints on mps_key_align on manual pools.Richard Brooksby2016-03-271-5/+21
| | | | | | | Copied from Perforce Change: 190472 ServerID: perforce.ravenbrook.com
* Use the nelems macro to compute the size of arrays.Gareth Rees2014-09-261-4/+4
| | | | | | | Copied from Perforce Change: 187055 ServerID: perforce.ravenbrook.com
* Flush telemetry before aborting in the test suite.Gareth Rees2014-07-021-0/+1
| | | | | | | Copied from Perforce Change: 186788 ServerID: perforce.ravenbrook.com
* Ensure that the amcss test case uses a wide range of arena grain sizes (by ↵Gareth Rees2014-06-301-3/+2
| | | | | | | | | | | | | scaling up the whole allocation). Remove hack from rnd_grain -- this was covering up a bug. Base the AMC "large" segment determination on the requested object size, not the (rounded up) segment size. Assert in the case where largeSize < extendBy: this has bad space performance. Copied from Perforce Change: 186755 ServerID: perforce.ravenbrook.com
* Need more grains, otherwise there's so much wasted space in each grain that ↵Gareth Rees2014-06-191-3/+5
| | | | | | | | | we don't meet the commit limit requirements. Copied from Perforce Change: 186697 ServerID: perforce.ravenbrook.com
* Log2 defined in c99 (not c90), not available on windows.Gareth Rees2014-06-181-2/+2
| | | | | | | Copied from Perforce Change: 186680 ServerID: perforce.ravenbrook.com
* Fix problems noted by rb in review ↵Gareth Rees2014-06-181-1/+9
| | | | | | | | | <https://info.ravenbrook.com/mail/2014/06/18/14-40-10/0/> Copied from Perforce Change: 186669 ServerID: perforce.ravenbrook.com
* Remove unnecessary headers from the test suite.Gareth Rees2014-04-081-7/+5
| | | | | | | Copied from Perforce Change: 185340 ServerID: perforce.ravenbrook.com
* Catch-up merge from master sources to branch/2014-03-21/pellesc.Gareth Rees2014-03-281-13/+0
|\ | | | | | | | | | | | | Copied from Perforce Change: 185074 ServerID: perforce.ravenbrook.com
| * Remove #pragma warning(disable: ...) for microsoft visual c/c++ warnings ↵Gareth Rees2014-03-281-13/+0
| | | | | | | | | | | | | | | | | | that are no longer generated by the code, so that we get the maximum checking from this compiler. Copied from Perforce Change: 185072 ServerID: perforce.ravenbrook.com
* | Fix review comments from dl ↵Gareth Rees2014-03-261-0/+2
| | | | | | | | | | | | | | | | | | | | | | <https://info.ravenbrook.com/mail/2014/03/25/17-44-56/0/>. Add __attribute__((__format__(printf))) to functions that take a printf-compatible format string (when building using GCC or Clang), so that format string mistakes can be detected statically. Copied from Perforce Change: 185021 ServerID: perforce.ravenbrook.com
* | Improved support for pelles c:Gareth Rees2014-03-241-7/+7
|/ | | | | | | | | | | | | | | | | | * Refactor nmake files so that a compiler-specific makefile is included; move Microsoft Visual C-specific options to mv.nmk. * Add nmake files for Pelles (w3i3pc.nmk and pc.nmk). * Rename spw3i3mv.c to spw3i3.c and spw3i6mv.c to spw3i6.c since these are also used by Pelles C. * Make reasonable changes to the source code to avoid warnings from Pelles C: ** check results of function calls; ** avoid useless return values; ** undef max before defining it; ** ensure printf formats are checkable; ** move notreached() assertions to the end of blocks; ** suppress warnings in cases where the code shouldn't be changed ("Unreachable code", "Inline assembly code is not portable", "Structured Exception Handling is not portable"). Copied from Perforce Change: 184977 ServerID: perforce.ravenbrook.com
* Ensure that all test cases call testlib_init so that the testlib assertion ↵Gareth Rees2014-03-241-2/+10
| | | | | | | | | handler is installed: this ensures that on windows you can set mps_testlib_noabort to avoid the dialog box from abort(). Copied from Perforce Change: 184965 ServerID: perforce.ravenbrook.com
* Declaring result codes using a relational macro, so that tests can print ↵Richard Brooksby2014-02-191-9/+21
| | | | | | | | | more meaningful output, and to eliminate redundant code. Copied from Perforce Change: 184382 ServerID: perforce.ravenbrook.com
* Catch-up merge from master.Richard Brooksby2014-01-241-1/+10
|\ | | | | | | | | | | | | Copied from Perforce Change: 184103 ServerID: perforce.ravenbrook.com
| * Avoid calling abort() on windows when running the test suite, so that the ↵Gareth Rees2013-07-151-1/+10
| | | | | | | | | | | | | | | | | | test suite doesn't get suspended waiting for someone to press a button. Copied from Perforce Change: 183041 ServerID: perforce.ravenbrook.com
* | Adding recursion factor and repeatable random number seeding to dj benchmark.Richard Brooksby2013-06-161-5/+11
|/ | | | | | | Copied from Perforce Change: 182776 ServerID: perforce.ravenbrook.com
* Call abort() instead of exit() for convenience when debugging.Gareth Rees2013-06-041-1/+1
| | | | | | | Copied from Perforce Change: 182495 ServerID: perforce.ravenbrook.com
* Catch-up merge from master sources to mps/branch/2013-05-17/emergencyGareth Rees2013-06-031-0/+10
|\ | | | | | | | | | | | | Copied from Perforce Change: 182417 ServerID: perforce.ravenbrook.com
| * Catch-up merge from custom/cet/main to master.Richard Brooksby2013-05-241-0/+10
| | | | | | | | | | | | | | | | | | Includes installable assertion handler, events in circular memory buffers, LARGEADDRESSAWARE, etc. Copied from Perforce Change: 182176 ServerID: perforce.ravenbrook.com
* | Catch-up merge from the master sources to branch/2013-05-17/emergency.Gareth Rees2013-05-231-0/+1
|\ \ | |/ | | | | | | | | | | Copied from Perforce Change: 182135 ServerID: perforce.ravenbrook.com
| * Ensure that the random seed is not lost in case of failure.Gareth Rees2013-05-231-0/+1
| | | | | | | | | | | | | | Copied from Perforce Change: 182131 ServerID: perforce.ravenbrook.com
* | In mv2test, use the random number generator from testlib. (this reduces ↵Gareth Rees2013-05-211-0/+5
|/ | | | | | | | | duplication and makes test cases repeatable.) Copied from Perforce Change: 182046 ServerID: perforce.ravenbrook.com
* Eventclock has enough entropy on all the platforms we support that we can ↵Gareth Rees2013-05-161-29/+10
| | | | | | | | | use it to choose the random number seed. Copied from Perforce Change: 181855 ServerID: perforce.ravenbrook.com
* Improve the usability of the test suite:Gareth Rees2013-03-071-5/+7
| | | | | | | | | | | | | 1. "make test" now reports the name of the test case before running it, so that when you look back through the test output you can see which test case failed. 2. "make test" now collects the standard output from all the tests to a log file in /tmp, so that this does not clutter the user's terminal, and so that nothing is lost if the output exceeds the terminal's scrollback. 3. Each test case now prints a success message ("Conclusion: Failed to find any defects.") to standard output (not standard error) so that these messages do not clutter up the terminal when running "make test". 4. Each test case now uses its result code (not the printed message) to indicate whether it succeeded or failed. 5. More of the diagnostic messages from the test cases now start by printing argv[0] so that it is easier to tell which test case was running. Copied from Perforce Change: 181071 ServerID: perforce.ravenbrook.com
* Partial merge of branch/2012-07-23/cet-transform, excluding cet-specific parts.Richard Brooksby2012-09-061-0/+9
| | | | | | | Copied from Perforce Change: 179309 ServerID: perforce.ravenbrook.com
* Fixing warnings revealed by xcode (clang).Richard Brooksby2012-08-111-1/+1
| | | | | | | Copied from Perforce Change: 178898 ServerID: perforce.ravenbrook.com
* mps br/vmem: simple-chunk-return:Richard Kistruck2010-03-231-7/+11
| | | | | | | | | testlib.c (comments only) record dates of changes from v1 -> v2 -> v3 rnd_states. Copied from Perforce Change: 170094 ServerID: perforce.ravenbrook.com
* mps br/vmem: simple-chunk-return:Richard Kistruck2010-03-221-18/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | zcoll.c: How to get rid of all the objects, so full collect really collects all automatic objects: - Rootdrop() helps, but we can still retain a 1.2MB object; - stackwipe() does not help much -- these unwanted ambig refs are being left on the stack by MPS code that runs between mps_arena_collect and the flip! - therefore StackScan(0/1) to destroy stack+reg root before full collect: it's the only way to be sure. Reproducibility: - give Make() a random? switch, acted on by df() = diversity function, to allow bypass of rnd(); - ZRndStateSet, to set the seed for rnd() Output: - print_M: switchable Mebibytes or Megabytes (more useful, to be honest); - get(): don't report message times, it messes up diffs. testlib.c/h: Reproducibility: - fix rnd_state so a rnd_state getter is possible; - testlib.h += rnd_state_t, rnd_state(), rnd_state_set(), rnd_state_set_v2() trace.c: traceFindGrey diag: no newline please Copied from Perforce Change: 170093 ServerID: perforce.ravenbrook.com
* Mps br/timing testlib.c: (fix compiler warning) msvc thinks "local variable ↵Richard Kistruck2009-02-161-1/+1
| | | | | | | | | 'r' may be used without having been initialized" Copied from Perforce Change: 167378 ServerID: perforce.ravenbrook.com
* Mps br/timing testlib.c: polish comments and code (no functionality change)Richard Kistruck2009-01-211-24/+27
| | | | | | | Copied from Perforce Change: 167192 ServerID: perforce.ravenbrook.com
* Mps br/timing testlib.c: fix warning ("... may be used uninitialized")Richard Kistruck2009-01-211-1/+1
| | | | | | | Copied from Perforce Change: 167188 ServerID: perforce.ravenbrook.com
* Mps br/timing rnd():Richard Kistruck2009-01-201-52/+149
| | | | | | | | | Use a = 48271. Use fast implementation. Much improved verification by rnd_verify(). Copied from Perforce Change: 167182 ServerID: perforce.ravenbrook.com
* Mps br.timing: testlib randomize() was wrong (simply discarding the first ↵Richard Kistruck2009-01-201-12/+87
| | | | | | | | | | | 0..32000 values is a throughly defective way to seed the generator). correct it to simply use timestamp (modulo m) as the initial seed, and then iterate 10 times. rnd(): add notes, and create rnd_verify() to confirm implementation is correct. Copied from Perforce Change: 167181 ServerID: perforce.ravenbrook.com
* Mps br/vc9: under ifdef mps_builder_mv, disable warning 4996 whereRichard Kistruck2008-10-201-11/+11
| | | | | | | | | necessary for VC9 builds. Copied from Perforce Change: 166497 ServerID: perforce.ravenbrook.com
* Mps br/vc9: undo #pragma warning (4996) in mpslib.h and mpswin.h; testlib.c ↵Richard Kistruck2008-09-101-0/+3
| | | | | | | | | is where it is needed Copied from Perforce Change: 166143 ServerID: perforce.ravenbrook.com
* Mps: attempt to fix w3i3mv "all" build with vc7:Richard Kistruck2006-04-071-0/+10
| | | | | | | | | | | (unknown if these changes are effective, but they should be safe) 1. mpm.c: +1 to array size to make room for terminator of string initializer; 2. testlib.c: disable warning 4702: unreachable code, for va_end. Copied from Perforce Change: 158055 ServerID: perforce.ravenbrook.com
* Changing global graphics copyright notice to say "portions copyright" to ↵Richard Brooksby2002-06-181-1/+1
| | | | | | | | | avoid confusion. Copied from Perforce Change: 30258 ServerID: perforce.ravenbrook.com
* Merging branch mps/2002-05-22/open-source-prep.Richard Brooksby2002-06-181-2/+44
|\ | | | | | | | | | | | | | | | | | | Making some new files consistent with changes from that branch. Deleting some new Global Graphics confidential files. Copied from Perforce Change: 30256 ServerID: perforce.ravenbrook.com
| * Eliminating "impl" type tags and replacing them with uri-style file references.Richard Brooksby2002-06-071-1/+1
| | | | | | | | | | | | | | Copied from Perforce Change: 29900 ServerID: perforce.ravenbrook.com