1 /*****************************************************************************\
4 * Author : Chris Koeritz *
6 *******************************************************************************
7 * Copyright (c) 2005-$now By Author. This program is free software; you can *
8 * redistribute it and/or modify it under the terms of the GNU General Public *
9 * License as published by the Free Software Foundation; either version 2 of *
10 * the License or (at your option) any later version. This is online at: *
11 * http://www.fsf.org/copyleft/gpl.html *
12 * Please send any updates to: fred@gruntose.com *
13 \*****************************************************************************/
15 #include <application/hoople_main.h>
16 #include <basis/astring.h>
17 #include <basis/guards.h>
18 #include <loggers/program_wide_logger.h>
19 #include <mathematics/chaos.h>
20 #include <structures/unique_id.h>
21 #include <structures/static_memory_gremlin.h>
22 #include <unit_test/unit_base.h>
25 #define LOG(to_print) EMERGENCY_LOG(program_wide_logger::get(), to_print)
28 using namespace application;
29 using namespace basis;
30 ///using namespace configuration;
31 using namespace mathematics;
32 using namespace filesystem;
33 using namespace loggers;
34 using namespace structures;
35 using namespace textual;
36 using namespace timely;
37 using namespace unit_test;
44 class test_unique_id : public virtual unit_base, public virtual application_shell
48 DEFINE_CLASS_NAME("test_unique_id");
52 HOOPLE_MAIN(test_unique_id, );
56 int test_unique_id::execute()
62 ASSERT_TRUE(ted.raw_id(), "testing non-zero should not claim was zero");
63 ASSERT_TRUE(!jed, "testing zero should claim was zero");
64 ASSERT_TRUE(!!ted, "testing non-zero doubled should not claim was zero");
65 ASSERT_TRUE(!!!jed, "testing zero doubled should claim was zero");
70 ASSERT_EQUAL(med.raw_id(), ted.raw_id(), "testing equality 1 should have correct result");
71 ASSERT_EQUAL(fed.raw_id(), jed.raw_id(), "testing equality 2 should have correct result");
72 ASSERT_INEQUAL(med.raw_id(), jed.raw_id(), "testing equality 3 should have correct result");
73 ASSERT_INEQUAL(fed.raw_id(), ted.raw_id(), "testing equality 4 should have correct result");
75 ASSERT_FALSE(med != ted, "equality operator 1 should have correct result");
76 ASSERT_FALSE(fed != jed, "equality operator 2 should have correct result");
77 ASSERT_FALSE(med == jed, "equality operator 3 should have correct result");
78 ASSERT_FALSE(fed == ted, "equality operator 4 should have correct result");
80 return final_report();