24 using namespace basis;
37 virtual int execute();
40 int test_set::execute()
58 ASSERT_EQUAL(intersect.elements(), 1,
"intersection elements should be one");
59 ASSERT_TRUE(intersect.member(23),
"element should be present as 23");
62 ASSERT_EQUAL(uni.elements(), 4,
"union elements should be correct");
63 ASSERT_TRUE(uni.member(23),
"first element we seek should be present");
64 ASSERT_TRUE(uni.member(90123),
"second element we seek should be present");
65 ASSERT_TRUE(uni.member(13),
"third element we seek should be present");
66 ASSERT_TRUE(uni.member(8012),
"fourth element we seek should be present");
68 return final_report();
The application_shell is a base object for console programs.
A simple object that wraps a templated set of ints.
set set_union(const set &union_with) const
Implements the set union of "this" with "union_with".
set intersection(const set &intersect_with) const
Returns the intersection of "this" with the set in "intersect_with".
bool add(const contents &to_add)
Adds a new element "to_add" to the set.
bool non_empty() const
Returns true if the set has some elements.
bool empty() const
Returns true if the set has no elements.
#define DEFINE_CLASS_NAME(objname)
Defines the name of a class by providing a couple standard methods.
#define FUNCDEF(func_in)
FUNCDEF sets the name of a function (and plugs it into the callstack).
Provides macros that implement the 'main' program of an application.
#define HOOPLE_MAIN(obj_name, obj_args)
options that should work for most unix and linux apps.
Implements an application lock to ensure only one is running at once.
The guards collection helps in testing preconditions and reporting errors.
A logger that sends to the console screen using the standard output device.
An extension to floating point primitives providing approximate equality.
A dynamic container class that holds any kind of object via pointers.
Useful support functions for unit testing, especially within hoople.
#define ASSERT_EQUAL(a, b, test_name)
#define ASSERT_TRUE(a, test_name)
#define ASSERT_FALSE(a, test_name)