Boost logo

Boost :

From: Dean Michael Berris (mikhailberis_at_[hidden])
Date: 2006-09-13 15:45:18

Hi Maciej,

On 9/14/06, Maciej Sobczak <prog_at_[hidden]> wrote:
> What's the added value of the above when compared to:
> value_should_equal(my_value, 10);
> value_should_not_equal(my_value, 9);
> pointer_should_be_null(my_pointer);
> pointer_should_not_be_null(my_pointer);
> or maybe:
> should_equal(my_value, 10);
> should_not_equal(my_value, 9);
> should_be_null(my_pointer);
> should_not_be_null(my_pointer);

The added value I suppose would be the ability to store the spec<>
objects and even extend the specifications later. Consider having the
ability to wrap the spec<> object and decorating it to do something
else later -- specially making it more type-safe, and more intuitive
to use.

The problem with the above examples are that you need to remember
which one is the value being tested, and which one is the expected
result. Having something like


or perhaps:

spec<int> return_value = value(a);
// ...

vector<std::string> my_vector;
// ...

If the spec<> type derived from a parametric base class dependent on
the parameter to spec, perhaps other specifications can be defined and
added later.

The design of the library will greatly benefit in terms of
flexibility, without having to get stuck with just plain methods that
might be too hard to extend.


Dean Michael C. Berris
C++ Software Architect
Orange and Bronze Software Labs, Ltd. Co.
email: dean_at_[hidden]
mobile: +63 928 7291459
phone: +63 2 8943415
other: +1 408 4049532

Boost list run by bdawes at, gregod at, cpdaniel at, john at