Callout Tests

Table of contents

Example 1:

Now we can define a function that simulates an ordinary six-sided die.

int roll_die() {
  boost::uniform_int<> dist(1, 6); (1)
}

(1)

create a uniform_int distribution

Example 2:

int roll_die() {
  (1)boost::variate_generator<boost::mt19937&, boost::uniform_int<> > die(gen, dist);
}

(1)

test

Example 3:

int roll_die() {
  (1)boost::variate_generator<boost::mt19937&, boost::uniform_int<> > die(gen, dist);
}

(1)

test

Example 3 (again!):

int roll_die() {
  (1)boost::variate_generator<boost::mt19937&, boost::uniform_int<> > die(gen, dist);
}

(1)

test

Example 4:

int roll_die() {
  (1)boost::variate_generator<boost::mt19937&, boost::uniform_int<> > die(gen, dist);
  (2)boost::uniform_int<> dist(1, 6); (3)
}

(1)

callout 1

(2)

callout 2

(3)

create a uniform_int distribution

(1)boost::uniform_int<> dist(1, 6); (2)

(1)

callout 2

(2)

create a uniform_int distribution

Try callouts in a section

Example 1:

Now we can define a function that simulates an ordinary six-sided die.

int roll_die() {
  boost::uniform_int<> dist(1, 6); (1)
}

(1)

create a uniform_int distribution

Example 2:

int roll_die() {
  (1)boost::variate_generator<boost::mt19937&, boost::uniform_int<> > die(gen, dist);
}

(1)

test

Example 3:

int roll_die() {
  (1)boost::variate_generator<boost::mt19937&, boost::uniform_int<> > die(gen, dist);
}

(1)

test

Example 3 (again!):

int roll_die() {
  (1)boost::variate_generator<boost::mt19937&, boost::uniform_int<> > die(gen, dist);
}

(1)

test

Example 4:

int roll_die() {
  (1)boost::variate_generator<boost::mt19937&, boost::uniform_int<> > die(gen, dist);
  (2)boost::uniform_int<> dist(1, 6); (3)
}

(1)

callout 1

(2)

callout 2

(3)

create a uniform_int distribution

(1)boost::uniform_int<> dist(1, 6); (2)

(1)

callout 2

(2)

create a uniform_int distribution