ab4fa7bfee9a8d609e9b427f5b983576beff548a
[anna.git] / test / config / main.cpp
1 // ANNA - Anna is Not Nothingness Anymore                                                         //
2 //                                                                                                //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo                         //
4 //                                                                                                //
5 // See project site at http://redmine.teslayout.com/projects/anna-suite                           //
6 // See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
7
8
9 #define BOOST_TEST_MODULE ANNA_CONFIG_TEST
10
11 #include <anna/test/clang_specific.hpp>
12 #include <boost/test/included/unit_test.hpp>
13
14 #include <iostream>
15
16 #include <limits.h>
17
18 #include <anna/config/Release.hpp>
19 #include <anna/core/util/defines.hpp>
20
21 using namespace std;
22 using namespace anna;
23
24 BOOST_AUTO_TEST_CASE(release) {
25   string version = config::Release::getVersion();
26   cout << version << endl;
27   BOOST_REQUIRE(version.empty() == false);
28   int debug = version.find("/D");
29   int release = version.find("/O");
30 #ifdef _DEBUG
31   BOOST_REQUIRE(debug != string::npos);
32   BOOST_REQUIRE(release == string::npos);
33 #else
34   BOOST_REQUIRE(debug == string::npos);
35   BOOST_REQUIRE(
36     release != string::npos);
37 #endif
38 }
39
40 BOOST_AUTO_TEST_CASE(numbers) {
41   S64 ii64;
42   ii64 = LLONG_MAX;
43   BOOST_REQUIRE_EQUAL(ii64, LLONG_MAX);
44   ii64 = LLONG_MIN;
45   BOOST_REQUIRE_EQUAL(ii64, LLONG_MIN);
46   U64 u64;
47   u64 = ULLONG_MAX;
48   BOOST_REQUIRE_EQUAL(u64, ULLONG_MAX);
49 }