00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #include <basis/chaos.h>
00016 #include <basis/guards.h>
00017 #include <basis/istring.h>
00018 #include <data_struct/unique_id.h>
00019 #include <data_struct/static_memory_gremlin.h>
00020
00021 #ifdef DEBUG_STACK
00022 #include <loggers/console_logger.h>
00023 #include <stdio.h>
00024 console_logger out;
00025 #define LOG(to_print) { out.log(to_print); fflush(0); }
00026 #endif
00027
00028 #include <stdlib.h>
00029 #include <string.h>
00030
00031 HOOPLE_STARTUP_CODE;
00032
00033 int main(int formal(argc), char *formal(argv)[])
00034 {
00035 unique_int ted(25);
00036 unique_int jed;
00037
00038 if (!ted)
00039 deadly_error("t_unique_id", "testing non-zero", "claimed was zero");
00040 if (!!jed)
00041 deadly_error("t_unique_id", "testing zero", "claimed was not zero");
00042 if (!!!ted)
00043 deadly_error("t_unique_id", "testing non-zero doubled", "claimed was zero");
00044 if (!!!!jed)
00045 deadly_error("t_unique_id", "testing zero doubled", "claimed was not zero");
00046
00047 unique_int med(25);
00048 unique_int fed(0);
00049
00050 if (med != ted)
00051 deadly_error("t_unique_id", "testing equality 1", "incorrect result");
00052 if (fed != jed)
00053 deadly_error("t_unique_id", "testing equality 2", "incorrect result");
00054 if (med == jed)
00055 deadly_error("t_unique_id", "testing equality 3", "incorrect result");
00056 if (fed == ted)
00057 deadly_error("t_unique_id", "testing equality 4", "incorrect result");
00058
00059 guards::alert_message("unique_id:: works for those functions tested.");
00060 return 0;
00061 }
00062