• Immutable Page
  • Info
  • Attachments

Unit Testing

We need a unit testing framework for compiz to avoid random regressions during rapid development and large branch merges. This page documents what needs tests to be written, and what should be tested in each component

Plugin Interface

For each test on the plugin interface, we'll need to have a separate plugin for each of those, which tests I/O, etc

Core Plugin Interface

Each item with a /!\ needs a test.

  • atoms: Each atom should actually be available to us in the X Server. /!\

  • counted list: Should add items to the list and check the size. /!\

  • CompIcon: Should compare pixel data of icon to pixel data in property, check size /!\

  • CompMatch: Should set up every possible expression and attempt to match windows /!\

  • CompMatch: Should test plugin interface - create match and evaluate windows by it /!\

  • ModifierHandler: Should check keycodeToModifiers against table of known keycodes and modifiers /!\

  • ModifierHandler: Should check returned modMask against Modifier

  • CompOption: Should check each set option with the return value for that option /!\

  • CompOption: Should check operator overloads /!\

  • CompOption: Should check restrictions /!\

  • CompOption: Should check the static getFooOptionNamed functions with known options in lists /!\

  • CompRect: Should check results of getters when modifying a rect /!\

  • CompOutput: Should check returned workArea against struts /!\

  • CompOutput: Should check returned geometry by set geometry /!\

  • CompPlugin: LoaderLoadPlugin should actually load legit plugins and fail to load non-legit plugins /!\

  • CompPlugin: ListPluginsProc should actually work /!\

  • CompPlugin: CompPlugin::find should find active plugins /!\

  • CompPlugin: CompPlugin::load and CompPlugin::unload should actually load and unload plugins, even the ones with custom VTables /!\

  • CompPoint: Check arithmetic /!\

  • CompRegion: Check arithmetic /!\

  • PropertyWriter: Write and read some simple properties /!\

  • CompPlugin: CompPlugin::push and CompPlugin::pop should fail to load bad plugins and load good ones /!\

  • CompPlugin: CompPlugin::getPlugins should only return active plugins, CompPlugin::availablePlugins should return all known plugins /!\

  • CompPlugin: CompPlugin::getPluginABI, checkPluginABI should work /!\

  • PluginClassStorage: Test storing things against core, plugin class allocation, plugin class free /!\

  • CompScreen fileWatches: Test if fileWatchAdded and fileWatchRemoved get called with the right data when adding and removing file watches /!\

  • CompScreen plugins: Test if initPluginForScreen and finiPluginForScreen get called when plugin loads or doesn't load /!\

  • CompScreen options: Set option for plugin should get called when we change an option with libcompizconfig /!\

  • CompScreen session: Communicate with libICE and libsession, see if we get the right session events when we do

  • CompScreen handleEvent: Send every possible registered event, see if we get it, see if we get the ones that should be eaten /!\

  • CompScreen handleCompizEvent: Send a compiz event, we should receive it /!\

  • CompScreen fileToImage: Get image data, write image data, compare /!\

  • CompScreen imageToFile: Write image data, read image data, compare /!\

  • CompScreen matches: check if matchInitExp, matchExpHandlerChanged and matchPropertyChanged get called when they do /!\

  • CompScreen logMessage: Check stderr for actual logging, check if wrapped function gets called, check if CompLogLevelFatal aborts /!\

  • CompScreen showdesktop: enterShowDesktopMode () and leaveShowDesktopMode () should be called at the right time and check window properties after that /!\

  • CompScreen watchFd: Should actually get some events on the fd's we register /!\

  • CompScreen options: getOption and setOption should work, cross check with libcompizconfig /!\

  • CompScreen capabilities: XRandr (), randrEvent () XShape () shapeEvent () syncEvent () should all return the right things here /!\

  • CompScreen activeWindow: Should actually be the window with the focus (eg XGetInputFocus) /!\

  • CompScreen autoRaiseWindow: Should be the window that the cursor is over (check with XQueryPointer) /!\

  • CompScreen displayString: Should be the display string passed int the env, or a default one /!\

  • CompScreen findWindow: Should find a CompWindow based on a valid window that was toplevel before reparenting, findTopLevelWindow should do the same, but also for frames /!\

  • CompScreen properties: getWindowProp, setWindowProp, getWindowProp32, setWindowProp32 should all work /!\

  • CompScreen xkbEvent: should return correct signature /!\

  • CompScreen windows: should return all nonframe windows in XQueryTree /!\

  • CompScreen warpPointer Warp pointer, check with XQueryPointer /!\

  • CompScreen forEachWindow Should do an operation on each window /!\

  • CompScreen focusDefaultWindow Call, check which window got focus /!\

  • CompScreen insertWindow Insert window, check tree, ditto unhookWindow /!\

  • CompScreen pushGrab Should return a grab handle if that is valid, should not accept duplicate names, should fail if screen is already actively grabbed /!\

  • CompScreen removeGrab Should actually remove the grab /!\

  • CompScreen otherGrabExist otherGrabExist should return true if grabs other than specified exist, grabExist should return true if specified grab existss /!\

  • CompScreen grabbed should return true if the keyboard and pointer are grabbed /!\

  • CompScreen actions should be able to enable and disable actions, test keys, pointers, edges with XTest /!\

  • CompScreen toolkitAction should be able to trigger every toolkit action /!\

  • CompScreen runCommand should actually run commands, set env vars right, etc /!\

  • CompScreen moveViewport should actually move viewport /!\

  • CompScreen sendWindowActivationRequest send it to a testing window, check if we got WM_TAKE_FOCUS /!\

  • CompScreen output choosing: outputDeviceForPoint, outputDeviceForWindow, outputDeviceForGeometry should all work even in the case of weird outputs /!\

  • CompScreen viewport choosing: viewportForGeometry, should work /!\

  • CompScreen desktop windows: should return number of desktop windows (check against those with CompWindowTypeDesktop) /!\

  • CompScreen active window history: should return accurate history

  • CompScreen hasOverlappingOutputs: should return true if outputs do overlap /!\

  • CompScreen screenInfo: check against outputs /!\

  • CompScreen updateDefaultIcon should take whatever we throw at it /!\

  • CompScreen updateSupportedWmHints should call addSupportedAtoms

  • CompScreen internal actions should all do what they say /!\

  • CompTimer set check times, callbacks, etc /!\

  • CompTimer start should work, check with a variety of times, should correct when min > max or max < min, etc. Only get added once /!\

  • CompTimer stop should work, should have no effect if called more than once /!\

  • CompTimer setTimes should work even when timer is active /!\

OpenGL Plugin Interface

Composite Plugin Interface

Text Plugin Interface

Mousepoll Plugin Interface

Scale Plugin Interface

Animation Plugin Interface

Window Manager Interface

Extended Window Manager Hints

Inter Client Communication Conventions


Development/Proposals/UnitTesting (last edited 2011-01-30 12:54:47 by 203-59-81-207)