spielwiese
Last change
on this file since 47a5c2 was
b35b93,
checked in by Olaf Bachmann <obachman@…>, 26 years ago
|
This commit was generated by cvs2svn to compensate for changes in r1396,
which included commits to RCS files with non-trunk default branches.
git-svn-id: file:///usr/local/Singular/svn/trunk@1397 2c84dea3-7e68-4137-9b89-c4e89433aadc
|
-
Property mode set to
100644
|
File size:
1.4 KB
|
Line | |
---|
1 | LIB "tst.lib"; |
---|
2 | |
---|
3 | tst_init(); |
---|
4 | tst_ignore("CVS: $Id: dbm_s.tst,v 1.1.1.1 1998-04-17 15:07:41 obachman Exp $"); |
---|
5 | |
---|
6 | "=============================================="; |
---|
7 | " DBM link tests "; |
---|
8 | |
---|
9 | proc read_dbm_all (link l) |
---|
10 | { |
---|
11 | string s=""; |
---|
12 | s=read(l); |
---|
13 | while( s != "" ) |
---|
14 | { |
---|
15 | s,"=",read(l,s); |
---|
16 | s=read(l); |
---|
17 | } |
---|
18 | } |
---|
19 | proc read_dbm (link l) |
---|
20 | { |
---|
21 | string s=""; |
---|
22 | s=read(l); |
---|
23 | if( s != "" ) { s,"=",read(l,s); } |
---|
24 | } |
---|
25 | |
---|
26 | link l1="DBM:rw db1"; |
---|
27 | link l2="DBM:rw db2"; |
---|
28 | l1; |
---|
29 | |
---|
30 | int i; |
---|
31 | |
---|
32 | for(i=1;i<=5; i++) |
---|
33 | { |
---|
34 | write(l1,"Key"+string(i), "Value"+string(i)); |
---|
35 | write(l2,"Key"+string(i), "DB 2 : Value"+string(i)); |
---|
36 | } |
---|
37 | read_dbm(l1); |
---|
38 | read_dbm(l1); |
---|
39 | read_dbm(l2); |
---|
40 | read_dbm(l1); |
---|
41 | "**********************************************"; |
---|
42 | read_dbm_all(l2); |
---|
43 | "**********************************************"; |
---|
44 | read_dbm_all(l1); |
---|
45 | "**********************************************"; |
---|
46 | write(l1,"Key4", "NewValue4"); |
---|
47 | read(l1,"Key4"); |
---|
48 | write(l1,"Key2"); |
---|
49 | read(l1,"Key2"); |
---|
50 | l2="DBM:r db2"; |
---|
51 | write(l2,"Key4"); |
---|
52 | l1="DBM: db1"; |
---|
53 | write(l1,"Key4"); |
---|
54 | close(l1); |
---|
55 | close(l2); |
---|
56 | kill l1,l2; |
---|
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 | |
---|
70 | quit; |
---|
Note: See
TracBrowser
for help on using the repository browser.