fieker-DuValspielwiese
Last change
on this file since a866f1 was
ef52d6,
checked in by Oleksandr Motsak <motsak@…>, 11 years ago
|
Update testsuite wrt current master (320c4f5e64cad778b4ada9556a9b0a6c71cab83a)
NOTE: some wrong/bad tests were removed...
TODO: add the reset of these updates after updating LIB/
|
-
Property mode set to
100644
|
File size:
1.3 KB
|
Rev | Line | |
---|
[b35b93] | 1 | LIB "tst.lib"; |
---|
| 2 | |
---|
| 3 | tst_init(); |
---|
| 4 | |
---|
| 5 | "=============================================="; |
---|
| 6 | " DBM link tests "; |
---|
| 7 | |
---|
| 8 | proc read_dbm_all (link l) |
---|
| 9 | { |
---|
| 10 | string s=""; |
---|
| 11 | s=read(l); |
---|
| 12 | while( s != "" ) |
---|
| 13 | { |
---|
| 14 | s,"=",read(l,s); |
---|
| 15 | s=read(l); |
---|
| 16 | } |
---|
| 17 | } |
---|
| 18 | proc read_dbm (link l) |
---|
| 19 | { |
---|
| 20 | string s=""; |
---|
| 21 | s=read(l); |
---|
| 22 | if( s != "" ) { s,"=",read(l,s); } |
---|
| 23 | } |
---|
| 24 | |
---|
| 25 | link l1="DBM:rw db1"; |
---|
| 26 | link l2="DBM:rw db2"; |
---|
| 27 | l1; |
---|
| 28 | |
---|
| 29 | int i; |
---|
| 30 | |
---|
| 31 | for(i=1;i<=5; i++) |
---|
| 32 | { |
---|
| 33 | write(l1,"Key"+string(i), "Value"+string(i)); |
---|
| 34 | write(l2,"Key"+string(i), "DB 2 : Value"+string(i)); |
---|
| 35 | } |
---|
| 36 | read_dbm(l1); |
---|
| 37 | read_dbm(l1); |
---|
| 38 | read_dbm(l2); |
---|
| 39 | read_dbm(l1); |
---|
| 40 | "**********************************************"; |
---|
| 41 | read_dbm_all(l2); |
---|
| 42 | "**********************************************"; |
---|
| 43 | read_dbm_all(l1); |
---|
| 44 | "**********************************************"; |
---|
| 45 | write(l1,"Key4", "NewValue4"); |
---|
| 46 | read(l1,"Key4"); |
---|
| 47 | write(l1,"Key2"); |
---|
| 48 | read(l1,"Key2"); |
---|
[2a8e21] | 49 | //l2="DBM:r db2"; |
---|
| 50 | //write(l2,"Key4"); // should fail |
---|
[b35b93] | 51 | l1="DBM: db1"; |
---|
[68d66b] | 52 | write(l1,"Key4"); // should not fail |
---|
[b35b93] | 53 | close(l1); |
---|
| 54 | close(l2); |
---|
[2a8e21] | 55 | kill l1; |
---|
| 56 | kill l2; |
---|
[b35b93] | 57 | "**********************************************"; |
---|
| 58 | string s="12345678901234567890123456789012345678901234567890"; |
---|
| 59 | string t500=s+s+s+s+s+s+s+s+s+s; |
---|
| 60 | string t1k=t500+t500; |
---|
| 61 | link l="DBM:rw test"; |
---|
| 62 | write(l,"a2",s); |
---|
| 63 | read(l,"a2"); |
---|
| 64 | write(l,"a1",t1k); |
---|
| 65 | read(l,"a2"); |
---|
| 66 | read(l,"a1"); |
---|
| 67 | i=system("sh", "/bin/rm -f db1.dir db1.pag db2.dir db2.pag"); |
---|
| 68 | i=system("sh", "/bin/rm -f test.dir test.pag"); |
---|
| 69 | |
---|
[46976a6] | 70 | tst_status(1);$ |
---|
Note: See
TracBrowser
for help on using the repository browser.