Overview   Project   Class   Tree   Deprecated   Index 
0 A.D.
FRAMES    NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD

lib.tests
(lib.tests globals)

   in test_cache_adt.h
   in test_path_util.h

(lib.tests globals)


Macro Summary
 #define MEASURE(c, desc{srand(1int) cnt = 1TIMER_BEGIN(desc)for(int i = 0 i < 30000 i++){bool add = rand(1,10) < 7if(add){int key = cnt++int val = cnt++size_t size = (size_t)rand(1,100)uint cost = (uint)rand(1,100)c.add(key, val, size, cost)}else{size_t sizeint valuec.remove_least_valuable(&value, &size)}}TIMER_END(desc)}
          See test_cache_adt.h
 #define TEST_APPEND(path1, path2, flags, correct_result) { char dst[PATH_MAX] = {0} TS_ASSERT_OK(path_append(dst, path1, path2, flags)) TS_ASSERT_STR_EQUALS(dst, correct_result) }
          See test_path_util.h
 #define TEST_LAST_COMPONENT(path, correct_result) { const char* result = path_last_component(path) TS_ASSERT_STR_EQUALS(result, correct_result) }
          See test_path_util.h
 #define TEST_NAME_ONLY(path, correct_result) { const char* result = path_name_only(path) TS_ASSERT_STR_EQUALS(result, correct_result) }
          See test_path_util.h
 #define TEST_STRIP_FN(path_readonly, correct_result) { char path[PATH_MAX] path_copy(path, path_readonly) path_strip_fn(path) TS_ASSERT_STR_EQUALS(path, correct_result) }
          See test_path_util.h
 

Macro Detail

MEASURE

 #define MEASURE(c, desc{srand(1;int) cnt = 1;TIMER_BEGIN(desc);for(int i = 0; i < 30000; i++){bool add = rand(1,10) < 7;if(add){int key = cnt++;int val = cnt++;size_t size = (size_t)rand(1,100);uint cost = (uint)rand(1,100);c.add(key, val, size, cost);}else{size_t size;int value;c.remove_least_valuable(&value, &size);}}TIMER_END(desc);}
See test_cache_adt.h.

TEST_APPEND

 #define TEST_APPEND(path1, path2, flags, correct_result) { char dst[PATH_MAX] = {0}; TS_ASSERT_OK(path_append(dst, path1, path2, flags)); TS_ASSERT_STR_EQUALS(dst, correct_result); }
See test_path_util.h.

TEST_LAST_COMPONENT

 #define TEST_LAST_COMPONENT(path, correct_result) { const char* result = path_last_component(path); TS_ASSERT_STR_EQUALS(result, correct_result); }
See test_path_util.h.

TEST_NAME_ONLY

 #define TEST_NAME_ONLY(path, correct_result) { const char* result = path_name_only(path); TS_ASSERT_STR_EQUALS(result, correct_result); }
See test_path_util.h.

TEST_STRIP_FN

 #define TEST_STRIP_FN(path_readonly, correct_result) { char path[PATH_MAX]; path_copy(path, path_readonly); path_strip_fn(path); TS_ASSERT_STR_EQUALS(path, correct_result); }
See test_path_util.h.

 Overview   Project   Class   Tree   Deprecated   Index 
0 A.D.
Generated on September 04, 2007 at 18:13
CppDoc v2.4.0
FRAMES    NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD