We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have two classes with simple public members, when I provide constraints which define dependency between classes, I dont see any randomization e.g.
#include <crave/ConstrainedRandom.hpp> #include <crave/experimental/Experimental.hpp> #include <boost/format.hpp> #include <iostream> using namespace crave; class class_a : public crv_sequence_item { public: crv_variable<unsigned int> num; crv_constraint legal_num_class_C{ num() < 10 }; class_a(crave::crv_object_name name = "class_a") { } void print(){ std::cout<<" CLASS A num "<<num<<"\n"; } }; class class_b : public crv_sequence_item { public: crv_variable<unsigned int> powr; class_b(crave::crv_object_name name = "class_b") { } void print(){ std::cout<<" CLASS B POW "<<powr<<"\n"; } }; int main(int argc, char* argv[]) { crave::init("crave.cfg"); crave::set_global_seed(123456789); class_a a("a"); class_b b("b"); crv_constraint legal_pow_class_{ b.powr() == (1<<a.num()) }; CHECK(a.randomize()); CHECK(b.randomize()); a.print(); b.print(); }
I get values of num and powr as zero when printed CLASS A num 0 CLASS B POW 0
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I have two classes with simple public members, when I provide constraints which define dependency between classes, I dont see any randomization
e.g.
I get values of num and powr as zero when printed
CLASS A num 0
CLASS B POW 0
The text was updated successfully, but these errors were encountered: