]> git.tdb.fi Git - ext/sigc++-2.0.git/blob - tests/test_size.cc
Adjust the name of the library to match upstream
[ext/sigc++-2.0.git] / tests / test_size.cc
1 // -*- c++ -*-
2 /* Copyright 2002, The libsigc++ Development Team
3  *  Assigned to public domain.  Use as you wish without restriction.
4  */
5
6 #include "testutilities.h"
7 #include <sigc++/sigc++.h>
8 #include <iostream>
9 #include <cstdlib>
10
11 // The correct result of this test may be implementation-dependent.
12 // No attempt is made to decide if the result is correct.
13 // The test will succeed, unless it's started with erroneous command arguments.
14 // "./test_size --verbose" shows the sizes.
15
16 namespace
17 {
18 struct A
19 {
20   void foo();
21 };
22 } // end anonymous namespace
23
24 int main(int argc, char* argv[])
25 {
26   auto util = TestUtilities::get_instance();
27
28   if (!util->check_command_args(argc, argv))
29     return util->get_result_and_delete_instance() ? EXIT_SUCCESS : EXIT_FAILURE;
30
31   if (util->get_verbose())
32   {
33     std::cout << "sizes of public classes:" << std::endl;
34
35     std::cout << "  trackable:               " << sizeof(sigc::trackable) << std::endl;
36     std::cout << "  slot<void>:              " << sizeof(sigc::slot<void>) << std::endl;
37     std::cout << "  signal<void>:            " << sizeof(sigc::signal<void>) << std::endl;
38     std::cout << "  signal<void>::iterator:  " << sizeof(sigc::signal<void>::iterator) << std::endl;
39     std::cout << "  connection:              " << sizeof(sigc::connection) << std::endl;
40
41     std::cout << std::endl << "sizes of internal classes:" << std::endl;
42
43     std::cout << "  trackable_callback:      " << sizeof(sigc::internal::trackable_callback) << std::endl;
44     std::cout << "  trackable_callback_list: " << sizeof(sigc::internal::trackable_callback_list) << std::endl;
45     std::cout << "  slot_rep:                " << sizeof(sigc::internal::slot_rep) << std::endl;
46     std::cout << "  typed_slot_rep<mem_functor0<void,A> >: "
47               << sizeof(sigc::internal::typed_slot_rep<sigc::mem_functor0<void,A> >) << std::endl;
48     std::cout << "  signal_impl:             " << sizeof(sigc::internal::signal_impl) << std::endl;
49   }
50   return util->get_result_and_delete_instance() ? EXIT_SUCCESS : EXIT_FAILURE;
51 }