The Inbox: Tests-nice.111.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Inbox: Tests-nice.111.mcz

commits-2
A new version of Tests was added to project The Inbox:
http://source.squeak.org/inbox/Tests-nice.111.mcz

==================== Summary ====================

Name: Tests-nice.111
Author: nice
Time: 19 January 2011, 10:39:53.026 pm
UUID: 5c734c61-d1be-4251-93e4-20fe2645811b
Ancestors: Tests-ul.110

Use := assignments rather than _ in class comment examples.

=============== Diff against Tests-ul.110 ===============

Item was changed:
  Object subclass: #PrimCallControllerAbstract
  instanceVariableNames: 'treatedMethods logStream changeStatusOfFailedCallsFlag'
  classVariableNames: ''
  poolDictionaries: ''
  category: 'Tests-PrimCallController'!
 
+ !PrimCallControllerAbstract commentStamp: 'nice 3/25/2010 23:02' prior: 0!
- !PrimCallControllerAbstract commentStamp: 'sr 6/16/2004 09:42' prior: 0!
  A PrimCallController (PCC) serves for switching external prim calls (primitiveExternalCall) on and off: this is an abstract class, instantiate one of the subclasses PCCByLiterals and PCCByCompilation.
 
  External prim calls are used to access internal and external modules (plugins) as shown by
  SmalltalkImage current listLoadedModules.
  SmalltalkImage current listBuiltinModules.
  Note: not loaded external modules (since they have not been called so far) are not shown by these methods.
 
  Highlight: dis/en-abling prims by a PCC works for both internal and external modules!!
 
 
  To help you choosing the right subclass, some properties are listed in the following table:
 
  Functionality/Property | PCCByLiterals PCCByCompilation
  ------------------------------------------------------------------------------------------------------
  testing plugins | suited not suited
  permanent disabling of external prim calls | no yes
  ------------------------------------------------------------------------------------------------------
  method changes visible in changeset | no yes
  enabling survives snapshot/compilation | yes yes
  disabling survives snapshot/compilation | no yes
  speed disabling | fast medium
  speed enabling | fast slow
  CompiledMethod pointer valid after en/dis-abling | yes no
 
  Important: Be careful with mixing the use of different PCCs!! PCCByLiterals does not see prims disabled by PCCByCompilation and vice versa. For playing around you should start with PCCByLiterals; use PCCByCompilation only, if you know what you are doing!!
 
  In protocols 'ui controlling', 'ui logging' and 'ui querying' (please look into this class) are the most important user interface methods. Thereafter the methods in 'ui testing' could be of interest.
 
 
  Useful expressions:
 
  Controlling:
  "Factorial example"
  | pcc tDisabled tEnabled tEnabled2 |
+ pcc := PCCByLiterals new logStream: Transcript. "logStream set here for more info"
- pcc _ PCCByLiterals new logStream: Transcript. "logStream set here for more info"
  pcc disableCallsIntoModule: 'LargeIntegers'.
+ tDisabled := [1000 factorial] timeToRun.
- tDisabled _ [1000 factorial] timeToRun.
  pcc enableDisabled.
+ tEnabled := [1000 factorial] timeToRun.
+ tEnabled2 := [1000 factorial] timeToRun.
- tEnabled _ [1000 factorial] timeToRun.
- tEnabled2 _ [1000 factorial] timeToRun.
  {tDisabled. tEnabled. tEnabled2}
  Note: You shouldn't switch off module 'LargeIntegers' for a longer time, since this slows down your system.
 
  Querying:
  PCCByLiterals new methodsWithCall. "all calls"
  PCCByLiterals new methodsWithCall: 'prim1'. "call in all modules or without module"
  PCCByLiterals new methodsWithCallIntoModule: nil. "all calls without module"
  PCCByLiterals new methodsWithCallIntoModule: 'LargeIntegers'. "all calls into module 'LargeIntegers'"
  PCCByLiterals new
  methodsWithCallIntoModule: 'LargeIntegers'
  forClass: Integer. "all calls into module 'LargeIntegers' in class Integer"
  PCCByLiterals new
  methodsWithCallIntoModule: 'LargeIntegers'
  forClasses: Integer withAllSubclasses. "all calls into module 'LargeIntegers' in class Integer withAllSubclasses"
 
+ | pcc | (pcc := PCCByLiterals new) methodsWithCall
- | pcc | (pcc _ PCCByLiterals new) methodsWithCall
  collect: [:mRef | {mRef. pcc extractCallModuleNames: mRef}].
 
 
  Structure:
   treatedMethods Dictionary of MethodReferences->#disabled/#enabled
  -- contains changed methods and how they are changed last
   logStream WriteStream -- shows info about changed methods ifNotNil
   changeStatusOfFailedCalls Boolean -- if status of failed calls should be changed, default is false!