source: git/Tst/Short/dbm_s.tst @ 051432

spielwiese
Last change on this file since 051432 was 2a8e21, checked in by Hans Schoenemann <hannes@…>, 13 years ago
removed DBM:r test git-svn-id: file:///usr/local/Singular/svn/trunk@14163 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 1.4 KB
Line 
1LIB "tst.lib";
2
3tst_init();
4tst_ignore("CVS: $Id$");
5
6"==============================================";
7" DBM link tests ";
8
9proc 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}
19proc read_dbm (link l)
20{
21  string s="";
22  s=read(l);
23  if( s != "" ) { s,"=",read(l,s); }
24}
25
26link l1="DBM:rw db1";
27link l2="DBM:rw db2";
28l1;
29
30int i;
31
32for(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}
37read_dbm(l1);
38read_dbm(l1);
39read_dbm(l2);
40read_dbm(l1);
41"**********************************************";
42read_dbm_all(l2);
43"**********************************************";
44read_dbm_all(l1);
45"**********************************************";
46write(l1,"Key4", "NewValue4");
47read(l1,"Key4");
48write(l1,"Key2");
49read(l1,"Key2");
50//l2="DBM:r db2";
51//write(l2,"Key4"); // should fail
52l1="DBM: db1";
53write(l1,"Key4"); // should not fail
54close(l1);
55close(l2);
56kill l1;
57kill l2;
58"**********************************************";
59string s="12345678901234567890123456789012345678901234567890";
60string t500=s+s+s+s+s+s+s+s+s+s;
61string t1k=t500+t500;
62link l="DBM:rw test";
63write(l,"a2",s);
64read(l,"a2");
65write(l,"a1",t1k);
66read(l,"a2");
67read(l,"a1");
68i=system("sh", "/bin/rm -f db1.dir db1.pag db2.dir db2.pag");
69i=system("sh", "/bin/rm -f test.dir test.pag");
70
71tst_status(1);$
Note: See TracBrowser for help on using the repository browser.