📄 pblkeyfile_testframe.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML><HEAD> <TITLE>int pblKEYFILE_TestFrame</TITLE> <META NAME="GENERATOR" CONTENT="DOC++ 3.4.9"></HEAD> <center><H2>Program Base Library Functions</H2></center><H2>int <A HREF="#DOC.DOCU">pblKEYFILE_TestFrame</A></H2><H2>( int argc, char* argv[] )</H2><BLOCKQUOTE> test frame for the key file library</BLOCKQUOTE><A NAME="DOC.DOCU"></A><HR><H2>Documentation</H2><BLOCKQUOTE>test frame for the key file library<P>This test frame calls the key file library,it is an interactive test frame capable of regression tests.<P><B>Interactive mode:</B><UL>Call the program pblkftst from a UNIX or DOS shell.<BR>The following commands to test the PBL Key File Library are supplied:<UL><PRE> q FOR QUIT create <filename> open <filename> <update> close | flush | delete insert <key> <data> ninsert <n> <key> <data> find <key> < LT | LE | FI | EQ | LA | GE | GT > update <data> ndelete <n> first | last | next | prev | this | read list <n> </PRE></UL></UL><B>Interactive mode example:</B><UL>The following short examples demonstrates how to use the interactivetest frame. Lines starting with a # are printed by the programlines starting with other characters are user input.<UL><PRE>pblkftst<P>##command: create /tmp/keytest# create filename # pblKfCreate( /tmp/keytest )# ok!<P>##command: insert testkey testdata# insert key, data# pblKfInsert( 1, testkey, 8, testdata, 9 )# rc 0, pbl_errno 0, errno 0<P>##command: first# pblKfFirst( 1 )# datalen 9, key testkey, keylen 8<P>##command: close# pblKfClose( 1 )# rc 0, pbl_errno 0, errno 0<P>##command: quit </PRE></UL></UL><P><B>Regression mode:</B><UL>Put a sequence of test commands into a test batch file.<P>Example:<UL>Open a new file KEY0001.TST and add the following lines<PRE>create /tmp/keytest2insert testkey testdatafirstclosequit</PRE></UL>Then run pblkftst KEY0001.TST<P>The program creates a log file called <B>pblkftst.log</B> when run.This log file can be used as regression input file for furthertests.<UL><PRE>##command:create # create filename/tmp/key0001# pblKfCreate( /tmp/key0001 )# ok!<P>##command:insert # insert key, datatestkey testdata# pblKfInsert( 1, testkey, 8, testdata, 9 )# rc 0, pbl_errno 0, errno 0<P>##command:first# pblKfFirst( 1 )# datalen 9, key testkey, keylen 8<P>##command:close# pblKfClose( 1 )# rc 0, pbl_errno 0, errno 0<P>##command:quit</PRE></UL>Keep the contents of this file and diff it with the outout ofthe KEY0001.TST testcase you created whenever you changethe code of the library. <P>See <!1><A HREF="pblISAMFILE_TestFrame.html">pblISAMFILE_TestFrame</A> for an example of regressiontests with a test frame. The regression test cases given with<!1><A HREF="pblISAMFILE_TestFrame.html">pblISAMFILE_TestFrame</A> of course also test the PBL Key Filelibrary.</UL></BLOCKQUOTE><DL><DT><DD></DL><P><P><I><A HREF="index.html">Alphabetic index</A></I></P><HR><BR>This page was generated with the help of <A HREF="http://docpp.sourceforge.net">DOC++</A>.</BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -