rapidcheck
rapidcheck copied to clipboard
Adding example creating/using a generator with boost_test
I was wondering if you could add an example of creating your own generator and then using that generator with boost_test. Inside of generators.md you have a great example of how to create this generator for a Person but when I copy this code verbatim and try to use it with boost_test I get an error like this:
> test/key_properties.cpp:41:8: error: ‘Arbitrary’ is not a class template
> struct Arbitrary<Person> {
> ^
> test/key_properties.cpp:41:26: error: explicit specialization of non-template ‘key_properties::rc::Arbitrary’
> struct Arbitrary<Person> {
> ^
> test/key_properties.cpp:42:12: error: ‘Gen’ does not name a type
> static Gen<Person> arbitrary() {
> ^
> make[1]: *** [test/test_test_bitcoin-key_properties.o] Error 1
> make[1]: Leaving directory `/home/chris/dev/bitcoin/src'
> make: *** [all] Error 2
It seems like you are declaring your Arbitrary specialization in the namespace ::key_properties::rc, it needs to be ::rc.