Initial commit of files

This commit is contained in:
2021-01-22 10:16:20 -05:00
parent 32d165ec8f
commit ed92211680
534 changed files with 68563 additions and 19 deletions

12
tests/uri/CMakeLists.txt Normal file
View File

@ -0,0 +1,12 @@
cmake_minimum_required(VERSION 3.7)
set(NAME uri)
project(Cnomicon-Test)
set(TARGET ${NAME}_test)
# includes
include_directories(../include/libgps++ ../include/libnet++ ../include)
link_directories(../lib)
link_libraries(gps++ net++ net kmlbase kmldom kmlengine pthread rt)
# executables
add_executable(${TARGET} ${TARGET}.cpp)

35
tests/uri/uri_test.cpp Normal file
View File

@ -0,0 +1,35 @@
#include <stdio.h>
#include "UriParse.h"
int main( int argc, char *argv[] )
{
for ( int i=1 ; i<argc ; i++ )
{
UriParse uri;
printf( "Parsing: %s\n", argv[i] );
int n = uri.setUri( argv[i] );
if ( n > 0 )
{
printf( "\tparsed out %d fields\n", n );
printf( "\tproto: %s\n", uri.getProto() ); // scheme
printf( "\tuser: %s\n", uri.getUser() );
printf( "\tpass: %s\n", uri.getPassword() );
printf( "\thost: %s\n", uri.getHost() );
printf( "\tport: %s\n", uri.getService() );
printf( "\tpath: %s\n", uri.getPath() );
printf( "\trate: %d\n", uri.getRate() );
}
else
{
printf( "\tfailed!\n" );
}
printf( "\n" );
}
return 0;
}