first check-in of feisty meow codebase. many things broken still due to recent
[feisty_meow.git] / core / library / tests_basis / checkup.cpp
1 /*
2 *  Name   : checkup
3 *  Author : Chris Koeritz
4 **
5 * Copyright (c) 1990-$now By Author.  This program is free software; you can  *
6 * redistribute it and/or modify it under the terms of the GNU General Public  *
7 * License as published by the Free Software Foundation; either version 2 of   *
8 * the License or (at your option) any later version.  This is online at:      *
9 *     http://www.fsf.org/copyleft/gpl.html                                    *
10 * Please send any updates to: fred@gruntose.com                               *
11 */
12
13 #include "checkup.h"
14
15 #include <basis/astring.h>
16 #include <loggers/critical_events.h>
17
18 using namespace basis;
19 using namespace loggers;
20 using namespace unit_test;
21
22 namespace system_checkup {
23
24 #undef UNIT_BASE_THIS_OBJECT 
25 #define UNIT_BASE_THIS_OBJECT testing
26 #undef static_class_name
27 #define static_class_name() astring("system_checkup")
28
29 bool check_system_characteristics(unit_base &testing)
30 {
31   FUNCDEF("check_system_characteristics")
32   // a big assumption is that the size of an unsigned character is just
33   // one byte.  if this is not true, probably many things would break...
34   int byte_size = sizeof(abyte);
35   ASSERT_EQUAL(byte_size, 1, "byte size should be 1 byte");
36   int int16_size = sizeof(int16);
37   ASSERT_FALSE( (sizeof(uint16) != int16_size) || (int16_size != 2),
38       "uint16 size should be 2 bytes");
39   int uint_size = sizeof(un_int);
40 //hmmm: the checks are actually redundant...
41   ASSERT_FALSE( (uint_size != sizeof(int)) || (uint_size != 4),
42       "un_int size should be 2 bytes");
43   // all tests successfully passed.
44   return true;
45 }
46
47 #undef UNIT_BASE_THIS_OBJECT 
48 #define UNIT_BASE_THIS_OBJECT (*this)
49 #undef static_class_name
50
51 } // namespace
52