21 inline int *intcopy(
int i) {
int *ip =
new int; *ip = i;
return ip; }
23 #define CACHED(p,t) that(p.is_cached()).is_equal_to(t)
24 #define CACHED_p123(t1,t2,t3) all().of(CACHED(p1, t1), CACHED(p2, t2), CACHED(p3, t3))
26 void TEST_CachedPtr() {
27 using namespace cache;
94 const char *word[] = {
"apple",
"orange",
"pie",
"juice" };
106 for (
int i = P-1; i >= 0; --i) p[i].assign(
ARB_strdup(word[P-1-i]),
cache);
109 for (
int i = 2; i<
P; ++i)
TEST_REJECT(p[i].is_cached());
SMARTPTR access(Cache< SMARTPTR > &cache)
char * ARB_strdup(const char *str)
Cache for any SmartPtr type.
#define TEST_EXPECT(cond)
#define TEST_REJECT(cond)
void assign(SMARTPTR data, Cache< SMARTPTR > &cache)
Handle for Cache entries.
#define TEST_EXPECT_ZERO(cond)
#define TEST_EXPECTATION(EXPCTN)
void release(Cache< SMARTPTR > &cache)
#define TEST_EXPECT_EQUAL(expr, want)