|
wxMaxima
|
Hardening tests for EditorCell's text-editing core. More...
#include <wx/app.h>#include <wx/bitmap.h>#include <wx/dcmemory.h>#include <wx/event.h>#include <wx/frame.h>#include <wx/log.h>#include "Configuration.h"#include "worksheet/Worksheet.h"#include "cells/CellList.h"#include "cells/GroupCell.h"#include "cells/EditorCell.h"#include <cstdlib>#include <memory>#include <random>#include <stdexcept>#include <unistd.h>#include <catch2/catch.hpp>Data Structures | |
| class | TestApp |
Hardening tests for EditorCell's text-editing core.
EditorCell is large and its mutation paths (character input, Backspace/Delete, word/bracket motion, Tab, undo/redo) all compute indices into m_text by hand and then access it with at()/Mid()/SubString(). An off-by-one there is an out-of-bounds access that wxASSERTs in a Debug build and is undefined behaviour in Release.
Two kinds of test live here:
These exercise the real EditorCell/GroupCell/Worksheet/Configuration code (linked via the wxmTestApp object library).