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

fieker-DuValspielwiese
Last change on this file since a35862 was 46976a6, checked in by Olaf Bachmann <obachman@…>, 26 years ago
* added status check to regress.cmd * added tst_status(1); call to each tst file, just before quit git-svn-id: file:///usr/local/Singular/svn/trunk@2271 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: dbm_s.tst,v 1.2 1998-07-01 10:20:13 obachman Exp $");
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");
50l2="DBM:r db2";
51write(l2,"Key4");
52l1="DBM: db1";
53write(l1,"Key4");
54close(l1);
55close(l2);
56kill l1,l2;
57"**********************************************";
58string s="12345678901234567890123456789012345678901234567890";
59string t500=s+s+s+s+s+s+s+s+s+s;
60string t1k=t500+t500;
61link l="DBM:rw test";
62write(l,"a2",s);
63read(l,"a2");
64write(l,"a1",t1k);
65read(l,"a2");
66read(l,"a1");
67i=system("sh", "/bin/rm -f db1.dir db1.pag db2.dir db2.pag");
68i=system("sh", "/bin/rm -f test.dir test.pag");
69
70tst_status(1);$
Note: See TracBrowser for help on using the repository browser.