aboutsummaryrefslogtreecommitdiff
path: root/fuzz/build_seed.sh
blob: b6793e645282957955bae3e7f89a72ad1415f417 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#!/bin/sh
# This file is part of GDBM.
# Copyright (C) 2021-2022 Free Software Foundation, Inc.
#
# GDBM is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# GDBM is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GDBM. If not, see <http://www.gnu.org/licenses/>. */

set -e

unset wd
while getopts "C:" OPTION
do
    case $OPTION in
	C) wd=$OPTARG;;
    esac
done

if [ -n "$wd" ]; then
    if [ ! -d $wd ]; then
	mkdir $wd
    fi
    cd $wd
fi

for format in standard numsync; do
   gdbmtool <<EOF
set format=$format
open empty_$format
close

open one_$format
store key1 value1
close

set blocksize=512
open empty_b512_$format
close

set cachesize=512
open empty_b512_c512_$format
close

open one_b512_c512_$format
store key1 value1
close

open ten_b512_c512_$format
store key1 value1
store key2 value2
store key3 value3
store key4 value4
store key5 value5
store key6 value6
store key7 value7
store key8 value8
store key9 value9
store key10 value10

open nine_b512_c512_$format
store key1 value1
store key2 value2
store key3 value3
store key4 value4
store key5 value5
store key6 value6
store key7 value7
store key8 value8
store key9 value9
store key10 value10
delete key1
close

open one_b512_c512_ku_cs_$format
define key { uint k }
define content { string s }
store 1 value1
close

open one_b512_c512_ku_cu_$format
define key { uint k }
define content { uint v }
store 1 1
define key { string k }
store key1 1
define key { uint k }
define content { uint v[2] }
store 1 { { 1 , 2 } }
list
close

open one_b512_c512_ku_cusz_$format
define key { uint k }
define content { uint v, stringz s }
store 1 { 1 , value1 }
list
close
quit
EOF
done

Return to:

Send suggestions and report system problems to the System administrator.