diff options
Diffstat (limited to 'src/tests/xb_test_dbf_v4_nomemos.cpp')
-rwxr-xr-x | src/tests/xb_test_dbf_v4_nomemos.cpp | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/src/tests/xb_test_dbf_v4_nomemos.cpp b/src/tests/xb_test_dbf_v4_nomemos.cpp index 4036588..984eb63 100755 --- a/src/tests/xb_test_dbf_v4_nomemos.cpp +++ b/src/tests/xb_test_dbf_v4_nomemos.cpp @@ -2,7 +2,7 @@ XBase Software Library -Copyright (c) 1997,2003,2014,2022 Gary A Kunkel +Copyright (c) 1997,2003,2014,2022,2023 Gary A Kunkel The xb64 software library is covered under the terms of the GPL Version 3, 2007 license. @@ -56,9 +56,19 @@ int main( int argCnt, char **av ) { "",0,0,0 } }; + xbSchema MyV4ZipRecord[] = + { + { "ZIPCODE", XB_NUMERIC_FLD, 5, 0 }, + { "CITY", XB_CHAR_FLD, 30, 0 }, + { "STATE", XB_CHAR_FLD, 2, 0 }, + { "",0,0,0 } + }; + + xbXBase x; #ifdef XB_LOGGING_SUPPORT + x.SetLogDirectory( PROJECT_LOG_DIR ); x.EnableMsgLogging(); if( po ){ std::cout << "Logfile is [" << x.GetLogFqFileName().Str() << "]" << std::endl; @@ -69,7 +79,6 @@ int main( int argCnt, char **av ) #endif x.SetDataDirectory( PROJECT_DATA_DIR ); - x.EnableMsgLogging(); #ifdef XB_LOCKING_SUPPORT x.DisableDefaultAutoLock(); @@ -318,10 +327,26 @@ int main( int argCnt, char **av ) rc += TestMethod( po, "GetField()", V4Dbf.GetField( fldAMT, sf ), XB_NO_ERROR ); rc += TestMethod( po, "GetField()", sf, " 432.55", 9 ); + + xbDbf4 V4DbfZ( &x ); // version 4 dbf file + rc2 = V4DbfZ.CreateTable( "TestV4Zip.DBF", "TestV4Zip", MyV4ZipRecord, XB_OVERLAY, XB_MULTI_USER ); + rc += TestMethod( po, "CreateTable()", (xbInt32) rc2, XB_NO_ERROR ); + if( rc2 ) + x.DisplayError( rc2 ); + + + rc += TestMethod( po, "Close()", V4Dbf.Close(), XB_NO_ERROR ); if( po == 2 ) x.DisplayTableList(); + + rc += TestMethod( po, "Close()", V4DbfZ.Close(), XB_NO_ERROR ); + if( po == 2 ) + x.DisplayTableList(); + + + if( po > 0 || rc < 0 ) fprintf( stdout, "Total Errors = %d\n", rc * -1 ); |