2 * Name : test_enumerate_adapters *
3 * Author : Chris Koeritz *
4 * Purpose: Makes sure that the adapter enumerator function is working properly.
6 * Copyright (c) 2003-$now By Author. This program is free software; you can *
7 * redistribute it and/or modify it under the terms of the GNU General Public *
8 * License as published by the Free Software Foundation; either version 2 of *
9 * the License or (at your option) any later version. This is online at: *
10 * http://www.fsf.org/copyleft/gpl.html *
11 * Please send any updates to: fred@gruntose.com *
14 #include <application/hoople_main.h>
15 #include <basis/astring.h>
16 #include <basis/functions.h>
17 #include <loggers/critical_events.h>
18 #include <loggers/program_wide_logger.h>
19 #include <sockets/tcpip_stack.h>
20 #include <structures/static_memory_gremlin.h>
21 #include <structures/string_array.h>
22 #include <unit_test/unit_base.h>
27 using namespace application;
28 using namespace basis;
29 using namespace loggers;
30 using namespace mathematics;
31 using namespace sockets;
32 using namespace structures;
33 using namespace textual;
34 using namespace timely;
35 using namespace unit_test;
37 #define LOG(to_print) EMERGENCY_LOG(program_wide_logger().get(), astring(to_print))
39 class test_enum_adapaters : public virtual unit_base, virtual public application_shell
42 test_enum_adapaters() {}
43 DEFINE_CLASS_NAME("test_enum_adapaters");
44 virtual int execute();
47 int test_enum_adapaters::execute()
53 bool did_it = stack.enumerate_adapters(ips);
55 deadly_error(class_name(), func, "could not enumerate adapters");
57 for (int i = 0; i < ips.length(); i++) {
58 log(a_sprintf("%d: ", i+1) + ips[i]);
61 return final_report();
64 HOOPLE_MAIN(test_enum_adapaters, )