Changeset 5647 in orxonox.OLD for branches/network/src/subprojects
- Timestamp:
- Nov 20, 2005, 12:25:50 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/subprojects/network/network_unit_test.cc
r5630 r5647 8 8 #include "network_manager.h" 9 9 #include "network_socket.h" 10 #include "synchronizeable.h" 10 11 11 12 int verbose = 4; 12 13 13 14 15 /* outputs the help */ 14 16 int startHelp(int argc, char** argv) 15 17 { … … 17 19 printf(" --help: this output\n"); 18 20 printf(" --sockettest test network_socket\n"); 21 printf(" --frameworktest test the network module\n"); 19 22 printf("\n"); 20 23 } 21 24 25 26 /* test SDL network socket */ 22 27 int testSocket(int argc, char** argv) 23 28 { … … 107 112 } 108 113 114 115 int testFramework(int argc, char** argv) 116 { 117 printf("=================\n"); 118 printf("TestFramework\n"); 119 printf("=================\n"); 120 121 IPaddress ip; 122 //SDLNet_ResolveHost(&ip, "127.0.0.1", 9999); 123 SDLNet_ResolveHost(&ip, "localhost", 9999); 124 Synchronizeable sync; 125 126 /* create the network manager */ 127 NetworkManager* nm = new NetworkManager(); 128 129 /* initialize the network manager */ 130 nm->initialize(); 131 132 /* esatblish a connection */ 133 nm->establishConnection(ip, sync); 134 135 /* delete the network manager again */ 136 delete nm; 137 138 return 0; 139 } 140 141 109 142 /** 110 143 * … … 119 152 for(i = 1; i < argc; ++i) 120 153 { 121 if(! strcmp( "--help", argv[i]) || !strcmp("-h", argv[i])) return startHelp(argc, argv);122 154 //else if(!strcmp( "--gui", argv[i]) || !strcmp("-g", argv[i])) showGui = true; 123 else if (! strcmp( "--sockettest", argv[i]) || !strcmp("-s", argv[i])) return testSocket(argc, argv); 155 if (! strcmp( "--sockettest", argv[i]) || !strcmp("-s", argv[i])) return testSocket(argc, argv); 156 else if (! strcmp( "--frameworktest", argv[i]) || !strcmp("-s", argv[i])) return testFramework(argc, argv); 124 157 } 125 158 126 /* create the network manager */ 127 NetworkManager* nm = new NetworkManager(); 128 129 /* initialize the network manager */ 130 nm->initialize(); 131 132 /* esatblish a connection */ 133 nm->establishConnection(); 134 135 //ClassList::debug(3, 0); 136 159 startHelp(argc, argv); 160 137 161 return 0; 138 162 }
Note: See TracChangeset
for help on using the changeset viewer.