Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
Namespaces | |
namespace | QDOC_CATCH_GENERATORS_PRIVATE_NAMESPACE |
\variable PathGeneratorConfiguration::multi_device_path_probability | |
namespace | QDOC_CATCH_GENERATORS_QCHAR_ALPHABETS_NAMESPACE |
Classes | |
class | PathGeneratorConfiguration |
Defines some parameters to customize the generation of paths by a PathGenerator. More... | |
Functions | |
template<typename T > | |
Catch::Generators::GeneratorWrapper< T > | cycle (Catch::Generators::GeneratorWrapper< T > &&generator) |
Returns a generator that behaves like generator until generator is exhausted, repeating the same generation that generator produced, infinitely, afterwards. | |
template<typename T > | |
Catch::Generators::GeneratorWrapper< T > | oneof (std::vector< Catch::Generators::GeneratorWrapper< T > > &&generators, const std::vector< double > &weights) |
Returns a generator whose set of elements is the union of the set of elements of the generators in generators. | |
template<typename T > | |
Catch::Generators::GeneratorWrapper< T > | uniform_oneof (std::vector< Catch::Generators::GeneratorWrapper< T > > &&generators) |
Returns a generator whose set of elements is the union of the set of elements of the generators in generators and in which the distribution of the generated elements is uniform over generators. | |
template<typename T > | |
Catch::Generators::GeneratorWrapper< T > | uniformly_valued_oneof (std::vector< Catch::Generators::GeneratorWrapper< T > > &&generators, const std::vector< std::size_t > &amounts) |
Returns a generator whose set of elements is the union of the set of elements of the generators in generators and in which the distribution of the generated elements is uniform over the elements of generators. | |
Catch::Generators::GeneratorWrapper< std::vector< double > > | k_partition_of_r (double r, std::size_t k) |
Returns a generator that generates collections of k elements whose sum is r. | |
Catch::Generators::GeneratorWrapper< QString > | path (Catch::Generators::GeneratorWrapper< QString > &&device_generator, Catch::Generators::GeneratorWrapper< QString > &&root_component_generator, Catch::Generators::GeneratorWrapper< QString > &&directory_generator, Catch::Generators::GeneratorWrapper< QString > &&filename_generator, Catch::Generators::GeneratorWrapper< QString > &&separator_generator, PathGeneratorConfiguration configuration=PathGeneratorConfiguration{}) |
Returns a generator that produces QStrings that represent a path in a filesystem. | |
Catch::Generators::GeneratorWrapper< QString > | relaxed_portable_posix_path (double absolute_path_probability=0.5, double directory_path_probability=0.5) |
Returns a generator that generates strings representing POSIX compatible paths. | |
Catch::Generators::GeneratorWrapper< QString > | traditional_dos_path (double absolute_path_probability=0.5, double directory_path_probability=0.5, double multi_device_path_probability=0.5) |
Returns a generator that produces strings that represents traditional DOS paths as defined in \l {https://docs.microsoft.com/en-us/dotnet/standard/io/file-path-formats#traditional-dos-paths}. | |
Catch::Generators::GeneratorWrapper< QString > | native_path (double absolute_path_probability=0.5, double directory_path_probability=0.5) |
Returns a generator that generates QStrings that represents paths native to the underlying OS. | |
Catch::Generators::GeneratorWrapper< QString > | native_relative_path (double directory_path_probability=0.5) |
Returns a generator that generates QStrings that represents paths native to the underlying OS and that are always {Relative}. | |
Catch::Generators::GeneratorWrapper< QString > | native_relative_file_path () |
Returns a generator that generates QStrings that represents paths native to the underlying OS and that are always {Relative} and {To a File}. | |
Catch::Generators::GeneratorWrapper< QString > | native_relative_directory_path () |
Returns a generator that generates QStrings that represents paths native to the underlying OS and that are always {Relative} and {To a Directory}. | |
Catch::Generators::GeneratorWrapper< QChar > | character (char16_t lower_bound=std::numeric_limits< char16_t >::min(), char16_t upper_bound=std::numeric_limits< char16_t >::max()) |
Returns a generator of that generates elements of QChar whose ucs value is in the range [lower_bound, upper_bound]. | |
Catch::Generators::GeneratorWrapper< QString > | string (Catch::Generators::GeneratorWrapper< QChar > &&character_generator, qsizetype minimum_length, qsizetype maximum_length) |
Returns a generator that generates elements of QString from some amount of elements taken from character_generator. | |
Catch::Generators::GeneratorWrapper< QString > | empty_string () |
Returns an infinite generator whose elements are the empty QString. | |
|
inline |
Returns a generator of that generates elements of QChar whose ucs value is in the range [lower_bound, upper_bound].
When lower_bound = upper_bound, the generator infinitely generates the same character.
Definition at line 56 of file qchar_generator.h.
|
inline |
Returns a generator that behaves like generator until generator is exhausted, repeating the same generation that generator produced, infinitely, afterwards.
This is generally intended to produce infinite generators from finite ones.
For example, consider a generator that produces values based on another generator that it owns. If the owning generator needs to produce more values that the owned generator can support, it might fail at some point. By cycling over the owned generator, we can extend the sequence of produced values so that enough are generated, in a controlled way.
The type T should generally be copyable for this generator to work.
Definition at line 76 of file cycle_generator.h.
|
inline |
Returns an infinite generator whose elements are the empty QString.
Definition at line 87 of file qstring_generator.h.
|
inline |
Returns a generator that generates collections of k elements whose sum is r.
r must be a real number greater or euqal to zero and k must be a natural number greater than zero.
The generated partitions tends to be uniformely distributed over the set of partitions of r.
Definition at line 109 of file k_partition_of_r_generator.h.
|
inline |
Returns a generator that generates QStrings that represents paths native to the underlying OS.
On Windows, paths that refer to a drive always refer to the root drive.
native* functions should always be chosen when using paths for testing interfacing with the filesystem itself.
System outside Linux, macOS or Windows are not supported.
Definition at line 739 of file path_generator.h.
|
inline |
Returns a generator that generates QStrings that represents paths native to the underlying OS and that are always {Relative} and {To a Directory}.
System outside Linux, macOS or Windows are not supported.
Definition at line 849 of file path_generator.h.
|
inline |
Returns a generator that generates QStrings that represents paths native to the underlying OS and that are always {Relative} and {To a File}.
System outside Linux, macOS or Windows are not supported.
Definition at line 838 of file path_generator.h.
|
inline |
Returns a generator that generates QStrings that represents paths native to the underlying OS and that are always {Relative}.
Avoids generating paths that refer to a directory that is not included in the path itself.
System outside Linux, macOS or Windows are not supported.
Definition at line 770 of file path_generator.h.
|
inline |
Returns a generator whose set of elements is the union of the set of elements of the generators in generators.
Each time the generator produces a value, a generator from generators is randomly chosen to produce the value.
The distribution for the choice is given by weights. The {ith} element in weights represent the percentage probability of the {ith} element of generators to be chosen.
It follows that the size of weights must be the same as the size of generators.
Furthermore, the sum of elements in weights should be a hundred.
The generator produces values until a generator that is chosen to produce a value is unable to do so. The first such generator to do so will stop the generation independently of the availability of the other generators.
Similarly, values will be produced as long as the chosen generator can produce a value, independently of the other generators being exhausted already.
Definition at line 91 of file oneof_generator.h.
|
inline |
Returns a generator that produces QStrings that represent a path in a filesystem.
A path is formed by the following components, loosely based on the abstraction that is used by std::filesystem::path:
\list
Each component is representable as a string and a path is a concatenation of the string representation of some components, with the following rules:
\list
For example, if "C:" is a {device} component, "\\" is a \e {root} component, "\" is a \e {separator} component, "directory" is a \e {directory} component and "filename" is a \e {filename} component, the following are all paths: "C:\directory", "C:\directory\directory", "C:filename", "directory\directory\", "\directory\filename", "filename". While the following aren't: "C:", "C:\", "directory\C:", "foo", "C:filename\", "filename\directory\filename", "filename\filename", "directorydirectory"."
The format of different components type can be the same. For example, the {root} and {separator} component in the above example. For the purpose of generation, we do not care about the format itself and consider a component of a certain type depending only on how it is generated/where it is generated from.
For example, if every component is formatted as the string "a", the string "aaa" could be a generated path. By the string alone, it is not possible to simply discern which components form it, but it would be possible to generate it if the first "a" is a {device} component, the second "a" is a {root} component and the third "a" is a {directory} or {filename} component.
A path, is further said to have some properties, pairs of which are exclusive to each other.
A path is said to be:
\list
All path are {Relative/Absolute}, {To a Directory/To a File} and {Multi-Device} or not.
Furthermore, a path that is {To a Directory} and whose last component is a {separator} component is said to {Have a Trailing Separator}.
Definition at line 469 of file path_generator.h.
|
inline |
Returns a generator that generates strings representing POSIX compatible paths.
The generated paths follows the format specified in \l {https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_271}.
The optional length-requirements, such as PATH_MAX and NAME_MAX, are relaxed away as they are generally not respected by modern systems.
It is possible to set the probability of obtaining a relative or absolute path through absolute_path_probability and the one of obtaining a path potentially pointing ot a directory or on a file through directory_path_probability.
Definition at line 652 of file path_generator.h.
|
inline |
Returns a generator that generates elements of QString from some amount of elements taken from character_generator.
The generated strings will have a length in the range [minimum_length, maximum_length].
For compatibility with the Qt API, it is possible to provide negative bounds for the length. This is, nonetheless, considered an error such that the bounds should always be greater or equal to zero.
It is similarly considered an error to have minimum_length <= maximum_length.
The provided generator will generate elements until character_generator is exhausted.
Definition at line 79 of file qstring_generator.h.
|
inline |
Returns a generator that produces strings that represents traditional DOS paths as defined in \l {https://docs.microsoft.com/en-us/dotnet/standard/io/file-path-formats#traditional-dos-paths}.
The directory and filename components of a path generated in this way are, currently, restricted to use a portable character set as defined by POSIX.
Do note that most paths themselves, will not be portable, on the whole, albeit they may be valid paths on other systems, as Windows uses a path system that is generally incompatible with other systems.
Some possibly valid special path, such as a "C:" or "\" will never be generated.
Definition at line 686 of file path_generator.h.
|
inline |
Returns a generator whose set of elements is the union of the set of elements of the generators in generators and in which the distribution of the generated elements is uniform over generators.
Each time the generator produces a value, a generator from generators is randomly chosen to produce the value.
Each generator from generators has the same chance of being chosen.
Do note that the distribution over the set of values is not necessarily uniform.
The generator produces values until a generator that is chosen to produce a value is unable to do so. The first such generator to do so will stop the generation independently of the availability of the other generators.
Similarly, values will be produced as long as the chosen generator can produce a value, independently of the other generators being exhausted already.
Definition at line 124 of file oneof_generator.h.
|
inline |
Returns a generator whose set of elements is the union of the set of elements of the generators in generators and in which the distribution of the generated elements is uniform over the elements of generators.
The generators in generator should have a uniform distribution and be finite. If the set of elements that the generators in generator is not disjoint, the distribution will be skewed towards repeated elements.
Each time the generator produces a value, a generator from generators is randomly chosen to produce the value.
Each generator from generators has a probability of being chosen based on the proportion of the cardinality of the subset it produces.
The {ith} element of amounts should contain the cardinality of the set produced by the {ith} generator in generators.
The generator produces values until a generator that is chosen to produce a value is unable to do so. The first such generator to do so will stop the generation independently of the availability of the other generators.
Similarly, values will be produced as long as the chosen generator can produce a value, independently of the other generators being exhausted already.
Definition at line 167 of file oneof_generator.h.
References QDOC_CATCH_GENERATORS_UTILITIES_ABSOLUTE_NAMESPACE::percent_of().