├── .gitignore ├── .travis.yml ├── BUILD ├── CONTRIBUTING.md ├── LICENSE ├── NOTES.md ├── README.md ├── WORKSPACE ├── doc ├── a-brief-tour-of-graphd.md ├── gr-model.txt ├── gr-protocol.txt ├── gr-replication.txt ├── gr-tuple.txt ├── graphd.8.md └── graphd.conf.5.md ├── gld ├── BUILD ├── gld-primitive.c ├── gld-request.c ├── gld-var.c ├── gld.c └── gld.h ├── go └── graphd │ ├── BUILD │ ├── connect.go │ ├── graphd.go │ ├── io.go │ ├── log.go │ ├── query.go │ ├── test │ ├── BUILD │ ├── fake.go │ └── fake_test.go │ └── url.go ├── graphd ├── BUILD ├── graphd-access.c ├── graphd-assignment.c ├── graphd-ast-debug.c ├── graphd-ast-debug.h ├── graphd-ast.c ├── graphd-ast.h ├── graphd-backend.c ├── graphd-bad-cache.c ├── graphd-build-version.c ├── graphd-cancel.c ├── graphd-checkcache.c ├── graphd-checkpoint.c ├── graphd-client-replica.c ├── graphd-comparator-case.c ├── graphd-comparator-datetime.c ├── graphd-comparator-default.c ├── graphd-comparator-number.c ├── graphd-comparator-octet.c ├── graphd-comparator.c ├── graphd-constraint-clause.c ├── graphd-constraint-cursor.c ├── graphd-constraint-iterator.c ├── graphd-constraint-or.c ├── graphd-constraint-path.c ├── graphd-constraint-setsize.c ├── graphd-constraint-signature.c ├── graphd-constraint-to-string.c ├── graphd-constraint.c ├── graphd-cost-parse.c ├── graphd-cost.c ├── graphd-database.c ├── graphd-dateline.c ├── graphd-dump.c ├── graphd-guid-constraint.c ├── graphd-guid-set.c ├── graphd-hash.h ├── graphd-idle.c ├── graphd-instance-id.c ├── graphd-interface-id.c ├── graphd-islink-group.c ├── graphd-islink-intersect.c ├── graphd-islink-job.c ├── graphd-islink-key.c ├── graphd-islink-side.c ├── graphd-islink-status.c ├── graphd-islink-type.c ├── graphd-islink.c ├── graphd-islink.h ├── graphd-iterate.c ├── graphd-iterator-and-check.c ├── graphd-iterator-and-freeze.c ├── graphd-iterator-and-optimize.c ├── graphd-iterator-and-process-state.c ├── graphd-iterator-and-run.c ├── graphd-iterator-and-statistics.c ├── graphd-iterator-and.c ├── graphd-iterator-and.h ├── graphd-iterator-cache.c ├── graphd-iterator-dump.c ├── graphd-iterator-fixed.c ├── graphd-iterator-idset.c ├── graphd-iterator-isa-storable.c ├── graphd-iterator-isa.c ├── graphd-iterator-isa.h ├── graphd-iterator-islink.c ├── graphd-iterator-linksto.c ├── graphd-iterator-or.c ├── graphd-iterator-prefix.c ├── graphd-iterator-resource.c ├── graphd-iterator-sort.c ├── graphd-iterator-state.c ├── graphd-iterator-vip.c ├── graphd-iterator-vrange.c ├── graphd-iterator-without.c ├── graphd-iterator.c ├── graphd-key.c ├── graphd-match.c ├── graphd-pattern-frame.c ├── graphd-pattern.c ├── graphd-predictable.c ├── graphd-primitive-dump.c ├── graphd-property.c ├── graphd-read-base-evaluate.c ├── graphd-read-base.c ├── graphd-read-one.c ├── graphd-read-or.c ├── graphd-read-set-count.c ├── graphd-read-set-cursor.c ├── graphd-read-set-defer.c ├── graphd-read-set-estimate.c ├── graphd-read-set.c ├── graphd-read.c ├── graphd-read.h ├── graphd-replica.c ├── graphd-request-input.c ├── graphd-request-output.c ├── graphd-request-run.c ├── graphd-request-size-max.c ├── graphd-request-timer.c ├── graphd-request-xstate.c ├── graphd-request.c ├── graphd-restore.c ├── graphd-result-token.c ├── graphd-runtime-statistics.c ├── graphd-sabotage.c ├── graphd-sabotage.h ├── graphd-semantic.c ├── graphd-session.c ├── graphd-set.c ├── graphd-shutdown.c ├── graphd-sleep.c ├── graphd-smp-config.c ├── graphd-smp-forward.c ├── graphd-smp-passthrough.c ├── graphd-smp-startup.c ├── graphd-smp.c ├── graphd-snapshot.c ├── graphd-snapshot.h ├── graphd-sort-compile.c ├── graphd-sort-root.c ├── graphd-sort.c ├── graphd-stack.c ├── graphd-startup.c ├── graphd-status.c ├── graphd-strerror.c ├── graphd-string-constraint.c ├── graphd-suspend-a-read.c ├── graphd-sync.c ├── graphd-text-compare.c ├── graphd-timestamp.c ├── graphd-token.c ├── graphd-type.c ├── graphd-unique.c ├── graphd-value.c ├── graphd-variable-analysis.c ├── graphd-variable-declaration.c ├── graphd-variable.c ├── graphd-verify.c ├── graphd-version.h ├── graphd-write-annotate-anchor.c ├── graphd-write-annotate-keyed.c ├── graphd-write-annotate-pointed.c ├── graphd-write-check-unique.c ├── graphd-write.c ├── graphd-write.h ├── graphd-writethrough.c ├── graphd-xstate.c ├── graphd.c └── graphd.h ├── libaddb ├── .cvsignore ├── .project ├── BUILD ├── README ├── addb-backup.c ├── addb-bgmap.h ├── addb-bmap.c ├── addb-bmap.h ├── addb-build-version.c ├── addb-clock.c ├── addb-create.c ├── addb-destroy.c ├── addb-file.c ├── addb-flat-close.c ├── addb-flat-file.h ├── addb-flat-open.c ├── addb-flat-read.c ├── addb-flat-remove.c ├── addb-flat-write.c ├── addb-flat.h ├── addb-gmap-access.c ├── addb-gmap-access.h ├── addb-gmap-add.c ├── addb-gmap-array.c ├── addb-gmap-backup.c ├── addb-gmap-bmap.c ├── addb-gmap-checkpoint.c ├── addb-gmap-close.c ├── addb-gmap-configure.c ├── addb-gmap-file.h ├── addb-gmap-freelist.c ├── addb-gmap-horizon.c ├── addb-gmap-iterator.c ├── addb-gmap-open.c ├── addb-gmap-partition.c ├── addb-gmap-refresh.c ├── addb-gmap-remove.c ├── addb-gmap-status.c ├── addb-gmap.h ├── addb-hmap-checkpoint.c ├── addb-hmap-file.h ├── addb-hmap-iterator.c ├── addb-hmap.c ├── addb-hmap.h ├── addb-idarray-intersect.c ├── addb-idarray.c ├── addb-istore-alloc.c ├── addb-istore-checkpoint.c ├── addb-istore-close.c ├── addb-istore-configure.c ├── addb-istore-file.h ├── addb-istore-free.c ├── addb-istore-horizon.c ├── addb-istore-index.c ├── addb-istore-marker.c ├── addb-istore-next-id.c ├── addb-istore-open.c ├── addb-istore-partition.c ├── addb-istore-read.c ├── addb-istore-reference.c ├── addb-istore-refresh.c ├── addb-istore-remove.c ├── addb-istore-status.c ├── addb-istore-write.c ├── addb-istore.h ├── addb-largefile-file.h ├── addb-largefile.c ├── addb-mem.c ├── addb-scalar.h ├── addb-smap-add.c ├── addb-smap-backup.c ├── addb-smap-checkpoint.c ├── addb-smap-close.c ├── addb-smap-freelist.c ├── addb-smap-horizon.c ├── addb-smap-open.c ├── addb-smap-partition.c ├── addb-smap-remove.c ├── addb-smap-status.c ├── addb-smap.h ├── addb-status.c ├── addb-strerror.c ├── addb-tiled.c ├── addb.c ├── addb.h ├── addbp.h └── addbspec.c ├── libcl ├── .cvsignore ├── BUILD ├── cl-abort-c.c ├── cl-build-version.c ├── cl-cover.c ├── cl-create.c ├── cl-destroy.c ├── cl-diary.c ├── cl-dup2.c ├── cl-file.c ├── cl-flush.c ├── cl-hard-error.c ├── cl-log-errno.c ├── cl-log.c ├── cl-loglevel.c ├── cl-netlog.c ├── cl-netlog3.c ├── cl-notreached.c ├── cl-set-abort.c ├── cl-set-coverage.c ├── cl-set-hard-error.c ├── cl-set-stacktrace.c ├── cl-set-strerror.c ├── cl-set-write.c ├── cl-siphon.c ├── cl-stack.c ├── cl-strerror.c ├── cl-syslog.c ├── cl-vlog.c ├── cl-wnotreached.c ├── cl-write-file.c ├── cl-write-netlog.c ├── cl-write-netlog3.c ├── cl-write-stderr.c ├── cl-write-syslog.c ├── cl.h └── clp.h ├── libcm ├── .cvsignore ├── BUILD ├── cm-argv.c ├── cm-buffer.c ├── cm-build-version.c ├── cm-c.c ├── cm-error.c ├── cm-hash.c ├── cm-heap.c ├── cm-list.c ├── cm-malcpy.c ├── cm-prefix.c ├── cm-resource.c ├── cm-runtime-statistics.c ├── cm-sprintf.c ├── cm-substr.c ├── cm-test.c ├── cm-trace.c ├── cm-zalloc.c └── cm.h ├── libes ├── .cvsignore ├── BUILD ├── README ├── es-application-event.c ├── es-build-version.c ├── es-close.c ├── es-create.c ├── es-demon.c ├── es-destroy.c ├── es-idle.c ├── es-loop.c ├── es-now.c ├── es-open.c ├── es-set-post-dispatch.c ├── es-set-pre-dispatch.c ├── es-subscribe.c ├── es-timeout.c ├── es-unsubscribe.c ├── es.h └── esp.h ├── libgdp ├── BUILD ├── gdp-error.h ├── gdp-input.c ├── gdp-input.h ├── gdp-lexer.c ├── gdp-lexer.h ├── gdp-micro.c ├── gdp-micro.h ├── gdp-misc.h ├── gdp-output.h ├── gdp-parse.c ├── gdp-private.h ├── gdp-token.c ├── gdp-token.h ├── gdp.c ├── gdp.h ├── grammar.awk └── grammar.sh ├── libgraph ├── .cvsignore ├── BUILD ├── README ├── graph-build-version.c ├── graph-create.c ├── graph-datatype.c ├── graph-dateline.c ├── graph-destroy.c ├── graph-fuzzy-compare.c ├── graph-grmap-dateline.c ├── graph-grmap-equal.c ├── graph-grmap-next.c ├── graph-grmap-range.c ├── graph-grmap-read.c ├── graph-grmap-table.c ├── graph-grmap-write.c ├── graph-grmap.c ├── graph-guid.c ├── graph-hullset.c ├── graph-idset-tile.c ├── graph-strerror.c ├── graph-timestamp.c ├── graph.h ├── graphdateline ├── graphdateline.c ├── graphdbid ├── graphdbid.c ├── graphgrmap.c ├── graphguid ├── graphguid.c ├── graphhullset ├── graphhullset.c ├── graphp.h ├── graphtimestamp └── graphtimestamp.c ├── libgraphdb ├── .cvsignore ├── BUILD ├── README ├── demo-poll.c ├── graphdb-address.c ├── graphdb-args.c ├── graphdb-args.h ├── graphdb-buffer-alloc.c ├── graphdb-buffer-dup.c ├── graphdb-buffer-format.c ├── graphdb-buffer-free.c ├── graphdb-build-version.c ├── graphdb-connect.c ├── graphdb-connection-drop.c ├── graphdb-create.c ├── graphdb-descriptor.c ├── graphdb-destroy.c ├── graphdb-heap.c ├── graphdb-initialize.c ├── graphdb-iterator.c ├── graphdb-log.c ├── graphdb-query.c ├── graphdb-reconnect-async.c ├── graphdb-request-alloc.c ├── graphdb-request-cancel.c ├── graphdb-request-chain.c ├── graphdb-request-free.c ├── graphdb-request-io.c ├── graphdb-request-lookup.c ├── graphdb-request-send.c ├── graphdb-request-wait.c ├── graphdb-server-error.c ├── graphdb-server-name.c ├── graphdb-set-logging.c ├── graphdb-set-loglevel.c ├── graphdb-set-memory.c ├── graphdb-set-reply-callback.c ├── graphdb-strerror.c ├── graphdb-time.c ├── graphdb-to-dot.c ├── graphdb-token.c ├── graphdb-transaction-id.c ├── graphdb.h └── graphdbp.h ├── libpdb ├── .cvsignore ├── BUILD ├── Makefile ├── README ├── pdb-bins-numtable.c ├── pdb-bins-numtable.h ├── pdb-bins-strtable.c ├── pdb-bins.c ├── pdb-build-version.c ├── pdb-checkpoint.c ├── pdb-concentric.c ├── pdb-configure.c ├── pdb-count.c ├── pdb-create.c ├── pdb-database-id.c ├── pdb-database-path.c ├── pdb-destroy.c ├── pdb-disk.c ├── pdb-generation.c ├── pdb-hash.c ├── pdb-id.c ├── pdb-index-bmap.c ├── pdb-index-gmap.c ├── pdb-index-hmap.c ├── pdb-index.c ├── pdb-initialize.c ├── pdb-is-remote-mounted.c ├── pdb-iterator-all.c ├── pdb-iterator-bgmap.c ├── pdb-iterator-by-name.c ├── pdb-iterator-gmap.c ├── pdb-iterator-hmap.c ├── pdb-iterator-null.c ├── pdb-iterator-smap.c ├── pdb-iterator-suspend.c ├── pdb-iterator-util.c ├── pdb-iterator.c ├── pdb-linkage.c ├── pdb-local-ip.c ├── pdb-lockfile.c ├── pdb-log.c ├── pdb-mem.c ├── pdb-msclock.c ├── pdb-prefix.c ├── pdb-primitive-alloc-subscription.c ├── pdb-primitive-alloc.c ├── pdb-primitive-compress.c ├── pdb-primitive-dump.c ├── pdb-primitive-finish.c ├── pdb-primitive-initialize.c ├── pdb-primitive-n.c ├── pdb-primitive-previous.c ├── pdb-primitive-read.c ├── pdb-primitive-reference.c ├── pdb-primitive-summary.c ├── pdb-primitive.h ├── pdb-refresh.c ├── pdb-restore.c ├── pdb-runtime-statistics.c ├── pdb-rxs.c ├── pdb-set-database-id.c ├── pdb-set-database-name.c ├── pdb-set-mode.c ├── pdb-set-path.c ├── pdb-set-predictable.c ├── pdb-set-sync.c ├── pdb-status.c ├── pdb-strerror.c ├── pdb-sync.c ├── pdb-truncate.c ├── pdb-util.c ├── pdb-verify.c ├── pdb-versioned.c ├── pdb-vip.c ├── pdb-word.c ├── pdb.h ├── pdbdump.c └── pdbp.h ├── libsrv ├── .cvsignore ├── BUILD ├── README ├── srv-address.c ├── srv-buffer-pool.c ├── srv-buffer.c ├── srv-buffered-connection.c ├── srv-build-version.c ├── srv-config.c ├── srv-delay.c ├── srv-epitaph.c ├── srv-idle.c ├── srv-interface-socket.c ├── srv-interface-socket.h ├── srv-interface-tcp.c ├── srv-interface-tcp.h ├── srv-interface-tty.c ├── srv-interface-unix.c ├── srv-interface.c ├── srv-interface.h ├── srv-main.c ├── srv-memory-list.c ├── srv-msclock.c ├── srv-pidfile.c ├── srv-request.c ├── srv-session.c ├── srv-settle.c ├── srv-shared.c ├── srv-sleep.c ├── srv-stat.c ├── srv-timeout.c ├── srv-unixid.c ├── srv.c ├── srv.h └── srvp.h ├── test └── unit │ ├── .cvsignore │ ├── 033-1.out.exp │ ├── 033-1.sh │ ├── 100x100.out.exp │ ├── 100x100.sh │ ├── 186.out.exp │ ├── 186.sh │ ├── 3323.out.exp │ ├── 3323.sh │ ├── 3692.out.exp │ ├── 3692.sh │ ├── 3816.out.exp │ ├── 3816.sh │ ├── 5230.out.exp │ ├── 5230.sh │ ├── BUILD │ ├── anchor.out.exp │ ├── anchor.sh │ ├── anchor2.out.exp │ ├── anchor2.sh │ ├── anchor3.out.exp │ ├── anchor3.sh │ ├── anchor4.out.exp │ ├── anchor4.sh │ ├── asof.out.exp │ ├── asof.sh │ ├── atleast.out.exp │ ├── atleast.sh │ ├── badcompare.out.exp │ ├── badcompare.sh │ ├── badrestore.out.exp │ ├── badrestore.sh │ ├── ben.in │ ├── ben.out.exp │ ├── ben.sh │ ├── ben2.err.exp │ ├── ben2.in │ ├── ben2.out.exp │ ├── ben2.sh │ ├── ben5.out.exp │ ├── ben5.sh │ ├── bendump.out.exp │ ├── bendump.sh │ ├── benrestore.out.exp │ ├── benrestore.sh │ ├── big.out.exp │ ├── big.sh │ ├── big1.out.exp │ ├── big1.sh │ ├── bigconf.conf │ ├── bigconf.sh │ ├── bigkey.out.exp │ ├── bigkey.sh │ ├── bootstrap.out.exp │ ├── bootstrap.sh │ ├── brendan1.out.exp │ ├── brendan1.sh │ ├── brendan2.out.exp │ ├── brendan2.sh │ ├── brendan3.in │ ├── brendan3.out.exp │ ├── brendan3.sh │ ├── brendan4.out.exp │ ├── brendan4.sh │ ├── bug5473.out.exp │ ├── bug5473.sh │ ├── byguid.out.exp │ ├── byguid.sh │ ├── camera.out.exp │ ├── camera.sh │ ├── cannotmatch.out.exp │ ├── cannotmatch.sh │ ├── cant-write-pid.err.exp │ ├── cant-write-pid.sh │ ├── chris1.out.exp │ ├── chris1.sh │ ├── chris2.in │ ├── chris2.out.exp │ ├── chris2.sh │ ├── chris3.out.exp │ ├── chris3.sh │ ├── chris4.out.exp │ ├── chris4.sh │ ├── chris5.out.exp │ ├── chris5.sh │ ├── chris6.out.exp │ ├── chris6.sh │ ├── chris7.out.exp │ ├── chris7.sh │ ├── colors.out.exp │ ├── colors.sh │ ├── colors2.out.exp │ ├── colors2.sh │ ├── colors3.out.exp │ ├── colors3.sh │ ├── comments.out.exp │ ├── comments.sh │ ├── compare.out.exp │ ├── compare.sh │ ├── compare1.out.exp │ ├── compare1.sh │ ├── compare2.out.exp │ ├── compare2.sh │ ├── cost1.out.exp │ ├── cost1.sh │ ├── cost2.broken.conf │ ├── cost2.conf │ ├── cost2.err.exp │ ├── cost2.out.exp │ ├── cost2.sh │ ├── cost2.short.broken.conf │ ├── cost2.short.conf │ ├── count0.out.exp │ ├── count0.sh │ ├── count1.out.exp │ ├── count1.sh │ ├── count2.out.exp │ ├── count2.sh │ ├── countabunch.out.exp │ ├── countabunch.sh │ ├── cursor1.out.exp │ ├── cursor1.sh │ ├── cursor2.out.exp │ ├── cursor2.sh │ ├── cursor3.out.exp │ ├── cursor3.sh │ ├── cursor4.out.exp │ ├── cursor4.sh │ ├── cursor5.out.exp │ ├── cursor5.sh │ ├── cursor6.out.exp │ ├── cursor6.sh │ ├── cvt.out.exp │ ├── cvt.sh │ ├── datatype.out.exp │ ├── datatype.sh │ ├── dateline-1.out.exp │ ├── dateline-1.sh │ ├── dateline-2.out.exp │ ├── dateline-2.sh │ ├── dateline-3.out.exp │ ├── dateline-3.sh │ ├── dateline-4.out.exp │ ├── dateline-4.sh │ ├── dateline-5.out.exp │ ├── dateline-5.sh │ ├── datetime-2.out.exp │ ├── datetime-2.sh │ ├── datetime.out.exp │ ├── datetime.sh │ ├── david_1.conf │ ├── david_1.out.exp │ ├── david_1.sh │ ├── david_10.out.exp │ ├── david_10.sh │ ├── david_2.out.exp │ ├── david_2.sh │ ├── david_3.out.exp │ ├── david_3.sh │ ├── david_4.conf │ ├── david_4.in │ ├── david_4.out.exp │ ├── david_4.sh │ ├── david_5.out.exp │ ├── david_5.sh │ ├── david_6.out.exp │ ├── david_6.sh │ ├── david_7.out.exp │ ├── david_7.sh │ ├── david_8.out.exp │ ├── david_8.sh │ ├── david_9.out.exp │ ├── david_9.sh │ ├── dbname.broken.conf │ ├── dbname.conf │ ├── dbname.err.exp │ ├── dbname.out.exp │ ├── dbname.sh │ ├── default-results.out.exp │ ├── default-results.sh │ ├── doubletrouble.err.exp │ ├── doubletrouble.sh │ ├── duck.out.exp │ ├── duck.sh │ ├── dump.out.exp │ ├── dump.sh │ ├── dump2.out.exp │ ├── dump2.sh │ ├── dumpnl.out.exp │ ├── dumpnl.sh │ ├── empty-result.out.exp │ ├── empty-result.sh │ ├── empty.out.exp │ ├── empty.sh │ ├── empty2.out.exp │ ├── empty2.sh │ ├── emptydump.out.exp │ ├── emptydump.sh │ ├── emptylit.out.exp │ ├── emptylit.sh │ ├── emptyrestore.out.exp │ ├── emptyrestore.sh │ ├── estimate-count.out.exp │ ├── estimate-count.sh │ ├── false.out.exp │ ├── false.sh │ ├── flags-1.out.exp │ ├── flags-1.sh │ ├── flags-2.out.exp │ ├── flags-2.sh │ ├── gpush.out.exp │ ├── gpush.sh │ ├── group.out.exp │ ├── group.sh │ ├── guid.out.exp │ ├── guid.sh │ ├── guid2.out.exp │ ├── guid2.sh │ ├── guidlist.out.exp │ ├── guidlist.sh │ ├── guidlist2.out.exp │ ├── guidlist2.sh │ ├── guidlist3.out.exp │ ├── guidlist3.sh │ ├── guidlist4.out.exp │ ├── guidlist4.sh │ ├── guidlist5.out.exp │ ├── guidlist5.sh │ ├── id.out.exp │ ├── id.sh │ ├── infcur.out.exp │ ├── infcur.sh │ ├── instance-id.conf │ ├── instance-id.out.exp │ ├── instance-id.sh │ ├── intrange.out.exp │ ├── intrange.sh │ ├── isa.out.exp │ ├── isa.sh │ ├── iterator1.out.exp │ ├── iterator1.sh │ ├── joburg.in │ ├── joburg.out.exp │ ├── joburg.sh │ ├── keyburn.out.exp │ ├── keyburn.sh │ ├── keyburn2.out.exp │ ├── keyburn2.sh │ ├── keyburn3.out.exp │ ├── keyburn3.sh │ ├── keyburn4.out.exp │ ├── keyburn4.sh │ ├── keyburn5.out.exp │ ├── keyburn5.sh │ ├── keyburn6.out.exp │ ├── keyburn6.sh │ ├── kurt1.out.exp │ ├── kurt1.sh │ ├── kurt2.out.exp │ ├── kurt2.sh │ ├── kurt3.out.exp │ ├── kurt3.sh │ ├── kurt4.out.exp │ ├── kurt4.sh │ ├── kurt5.out.exp │ ├── kurt5.sh │ ├── kurt6.out.exp │ ├── kurt6.sh │ ├── link1.out.exp │ ├── link1.sh │ ├── link2.out.exp │ ├── link2.sh │ ├── linklink1.out.exp │ ├── linklink1.sh │ ├── linklink2.out.exp │ ├── linklink2.sh │ ├── linklink3.out.exp │ ├── linklink3.sh │ ├── linklink4.out.exp │ ├── linklink4.sh │ ├── literal1.out.exp │ ├── literal1.sh │ ├── localtype.out.exp │ ├── localtype.sh │ ├── loglevel.out.exp │ ├── loglevel.sh │ ├── logrotate.conf │ ├── logrotate.out.exp │ ├── logrotate.sh │ ├── micro.out.exp │ ├── micro.sh │ ├── multibob.out.exp │ ├── multibob.sh │ ├── multirestore.out.exp │ ├── multirestore.sh │ ├── ne.out.exp │ ├── ne.sh │ ├── newline.out.exp │ ├── newline.sh │ ├── nick1.out.exp │ ├── nick1.sh │ ├── nick6.out.exp │ ├── nick6.sh │ ├── nodenode.out.exp │ ├── nodenode.sh │ ├── nonsense.in │ ├── nonsense.out.exp │ ├── nonsense.sh │ ├── now.out.exp │ ├── now.sh │ ├── nullcontent.out.exp │ ├── nullcontent.sh │ ├── nullguid.out.exp │ ├── nullguid.sh │ ├── nullguid2.out.exp │ ├── nullguid2.sh │ ├── nullvalue.out.exp │ ├── nullvalue.sh │ ├── numberequal.out.exp │ ├── numberequal.sh │ ├── numberequal2.out.exp │ ├── numberequal2.sh │ ├── numbermatch.out.exp │ ├── numbermatch.sh │ ├── octet.out.exp │ ├── octet.sh │ ├── ok.out.exp │ ├── ok.sh │ ├── onedump.out.exp │ ├── onedump.sh │ ├── onerestore.out.exp │ ├── onerestore.sh │ ├── optional.out.exp │ ├── optional.sh │ ├── or.out.exp │ ├── or.sh │ ├── or2.out.exp │ ├── or2.sh │ ├── or4.out.exp │ ├── or4.sh │ ├── override-dir-1.conf │ ├── override-dir-2.conf │ ├── override-dir.err.exp │ ├── override-dir.sh │ ├── pagesize.out.exp │ ├── pagesize.sh │ ├── param-order.out.exp │ ├── param-order.sh │ ├── pol.out.exp │ ├── pol.sh │ ├── previous.out.exp │ ├── previous.sh │ ├── ques.out.exp │ ├── ques.sh │ ├── random1.out.exp │ ├── random1.sh │ ├── random2.out.exp │ ├── random2.sh │ ├── random3.out.exp │ ├── random3.sh │ ├── random4.out.exp │ ├── random4.sh │ ├── random5.out.exp │ ├── random5.sh │ ├── random6.out.exp │ ├── random6.sh │ ├── random7.out.exp │ ├── random7.sh │ ├── rep1.err.exp │ ├── rep1.sh │ ├── rerestore.out.exp │ ├── rerestore.sh │ ├── rerestore2.out.exp │ ├── rerestore2.sh │ ├── rest-over1.in │ ├── rest-over1.out.exp │ ├── rest-over1.sh │ ├── rest-over2.out.exp │ ├── rest-over2.sh │ ├── results.out.exp │ ├── results.sh │ ├── rollback.out.exp │ ├── rollback.sh │ ├── rungraphd │ ├── search.out.exp │ ├── search.sh │ ├── simple.out.exp │ ├── simple.sh │ ├── slip.out.exp │ ├── slip.sh │ ├── sort1.out.exp │ ├── sort1.sh │ ├── sort10.out.exp │ ├── sort10.sh │ ├── sort11.out.exp │ ├── sort11.sh │ ├── sort12.out.exp │ ├── sort12.sh │ ├── sort13.out.exp │ ├── sort13.sh │ ├── sort14.out.exp │ ├── sort14.sh │ ├── sort15.out.exp │ ├── sort15.sh │ ├── sort16.out.exp │ ├── sort16.sh │ ├── sort17.out.exp │ ├── sort17.sh │ ├── sort18.out.exp │ ├── sort18.sh │ ├── sort19.out.exp │ ├── sort19.sh │ ├── sort2.out.exp │ ├── sort2.sh │ ├── sort20.out.exp │ ├── sort20.sh │ ├── sort3.out.exp │ ├── sort3.sh │ ├── sort4.out.exp │ ├── sort4.sh │ ├── sort5.out.exp │ ├── sort5.sh │ ├── sort6.out.exp │ ├── sort6.sh │ ├── sort7.out.exp │ ├── sort7.sh │ ├── sort8.out.exp │ ├── sort8.sh │ ├── sort9.out.exp │ ├── sort9.sh │ ├── sortcomparators.out.exp │ ├── sortcomparators.sh │ ├── sortcursor.out.exp │ ├── sortcursor.sh │ ├── sortnumber.out.exp │ ├── sortnumber.sh │ ├── source.out.exp │ ├── source.sh │ ├── spacematch.out.exp │ ├── spacematch.sh │ ├── start-twice.err.exp │ ├── start-twice.sh │ ├── start-unsorted.out.exp │ ├── start-unsorted.sh │ ├── start.out.exp │ ├── start.sh │ ├── status.out.exp │ ├── status.sh │ ├── stror.out.exp │ ├── stror.sh │ ├── substring.out.exp │ ├── substring.sh │ ├── substring2.out.exp │ ├── substring2.sh │ ├── substring3.out.exp │ ├── substring3.sh │ ├── sync.conf │ ├── sync2.out.exp │ ├── sync2.sh │ ├── syntaxerrs.out.exp │ ├── syntaxerrs.sh │ ├── tab.out.exp │ ├── tab.sh │ ├── test.sh │ ├── threedump.out.exp │ ├── threedump.sh │ ├── threerestore.out.exp │ ├── threerestore.sh │ ├── tiling.out.exp │ ├── tiling.sh │ ├── timesort.out.exp │ ├── timesort.sh │ ├── timestamp-2.out.exp │ ├── timestamp-2.sh │ ├── timestamp-3.out.exp │ ├── timestamp-3.sh │ ├── timestamp-4.out.exp │ ├── timestamp-4.sh │ ├── timestamp.out.exp │ ├── timestamp.sh │ ├── trailer.out.exp │ ├── trailer.sh │ ├── trailer2.out.exp │ ├── trailer2.sh │ ├── triad.out.exp │ ├── triad.sh │ ├── twovars.out.exp │ ├── twovars.sh │ ├── typeandtypeguid.out.exp │ ├── typeandtypeguid.sh │ ├── typo.out.exp │ ├── typo.sh │ ├── unique1.out.exp │ ├── unique1.sh │ ├── unique2.out.exp │ ├── unique2.sh │ ├── unique3.out.exp │ ├── unique3.sh │ ├── unique4.out.exp │ ├── unique4.sh │ ├── unique6.out.exp │ ├── unique6.sh │ ├── uniquecluster.out.exp │ ├── uniquecluster.sh │ ├── value.out.exp │ ├── value.sh │ ├── valuetype.out.exp │ ├── valuetype.sh │ ├── varerrs.out.exp │ ├── varerrs.sh │ ├── varor.out.exp │ ├── varor.sh │ ├── vars.out.exp │ ├── vars.sh │ ├── vars2.out.exp │ ├── vars2.sh │ ├── varsort.out.exp │ ├── varsort.sh │ ├── version1.out.exp │ ├── version1.sh │ ├── version2.out.exp │ ├── version2.sh │ ├── version3.out.exp │ ├── version3.sh │ ├── version4.out.exp │ ├── version4.sh │ ├── version5.out.exp │ ├── version5.sh │ ├── version7.out.exp │ ├── version7.sh │ ├── will1.out.exp │ ├── will1.sh │ ├── will2.out.exp │ ├── will2.sh │ ├── will3.out.exp │ ├── will3.sh │ ├── will4.out.exp │ ├── will4.sh │ ├── will5.out.exp │ ├── will5.sh │ ├── will6.out.exp │ ├── will6.sh │ ├── will8.out.exp │ ├── will8.sh │ ├── without.out.exp │ ├── without.sh │ ├── wordnet1.out.exp │ ├── wordnet1.sh │ ├── writeresult.out.exp │ ├── writeresult.sh │ ├── yesno.out.exp │ ├── yesno.sh │ ├── zeroguid.out.exp │ └── zeroguid.sh └── util ├── BUILD └── gpush.c /.gitignore: -------------------------------------------------------------------------------- 1 | bazel-* 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # trusty beta image has jdk8, gcc4.8.4 2 | dist: trusty 3 | sudo: required 4 | # xcode8 has jdk8 5 | osx_image: xcode8.3 6 | # Not technically required but suppresses 'Ruby' in Job status message. 7 | language: java 8 | 9 | os: 10 | - linux 11 | 12 | env: 13 | - V=0.16.0 14 | 15 | before_install: 16 | - | 17 | OS=linux 18 | URL="https://github.com/bazelbuild/bazel/releases/download/${V}/bazel-${V}-installer-${OS}-x86_64.sh" 19 | wget -O install.sh "${URL}" 20 | chmod +x install.sh 21 | ./install.sh --user 22 | rm -f install.sh 23 | 24 | script: 25 | - | 26 | bazel \ 27 | --host_jvm_args=-Xmx500m \ 28 | --host_jvm_args=-Xms500m \ 29 | test \ 30 | --local_resources=400,1,1.0 \ 31 | --test_output=errors \ 32 | //... 33 | 34 | notifications: 35 | email: false 36 | -------------------------------------------------------------------------------- /BUILD: -------------------------------------------------------------------------------- 1 | load("@bazel_gazelle//:def.bzl", "gazelle") 2 | 3 | # gazelle:prefix github.com/google/graphd/go/graphd 4 | # gazelle:build_file_name BUILD, BUILD.bazel 5 | gazelle(name = "gazelle") 6 | -------------------------------------------------------------------------------- /NOTES.md: -------------------------------------------------------------------------------- 1 | 1. graphd/graphd-ast-debug.h - macros need to be fixed. 2 | -------------------------------------------------------------------------------- /WORKSPACE: -------------------------------------------------------------------------------- 1 | load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") 2 | 3 | http_archive( 4 | name = "io_bazel_rules_go", 5 | url = "https://github.com/bazelbuild/rules_go/releases/download/0.18.1/rules_go-0.18.1.tar.gz", 6 | sha256 = "77dfd303492f2634de7a660445ee2d3de2960cbd52f97d8c0dffa9362d3ddef9", 7 | ) 8 | http_archive( 9 | name = "bazel_gazelle", 10 | urls = ["https://github.com/bazelbuild/bazel-gazelle/releases/download/0.14.0/bazel-gazelle-0.14.0.tar.gz"], 11 | sha256 = "c0a5739d12c6d05b6c1ad56f2200cb0b57c5a70e03ebd2f7b87ce88cabf09c7b", 12 | ) 13 | load("@io_bazel_rules_go//go:deps.bzl", "go_rules_dependencies", "go_register_toolchains") 14 | go_rules_dependencies() 15 | go_register_toolchains() 16 | load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies") 17 | gazelle_dependencies() 18 | -------------------------------------------------------------------------------- /gld/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | cc_binary( 4 | name = "gld", 5 | srcs = [ 6 | "gld.c", 7 | "gld.h", 8 | "gld-primitive.c", 9 | "gld-request.c", 10 | "gld-var.c", 11 | ], 12 | copts = [ 13 | "$(STACK_FRAME_UNLIMITED)", 14 | "-g", 15 | "-w", 16 | ], 17 | deps = [ 18 | "//libcl", 19 | "//libcm", 20 | "//libgraph", 21 | "//libgraphdb", 22 | ], 23 | ) 24 | -------------------------------------------------------------------------------- /go/graphd/BUILD: -------------------------------------------------------------------------------- 1 | load("@io_bazel_rules_go//go:def.bzl", "go_library") 2 | 3 | go_library( 4 | name = "go_default_library", 5 | srcs = [ 6 | "connect.go", 7 | "graphd.go", 8 | "log.go", 9 | "url.go", 10 | ], 11 | importpath = "github.com/google/graphd/go/graphd/go/graphd", 12 | visibility = ["//visibility:public"], 13 | ) 14 | -------------------------------------------------------------------------------- /go/graphd/test/BUILD: -------------------------------------------------------------------------------- 1 | load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") 2 | 3 | go_library( 4 | name = "go_default_library", 5 | srcs = ["fake.go"], 6 | importpath = "github.com/google/graphd/go/graphd/go/graphd/test", 7 | visibility = ["//visibility:public"], 8 | ) 9 | 10 | go_test( 11 | name = "go_default_test", 12 | srcs = ["fake_test.go"], 13 | embed = [":go_default_library"], 14 | ) 15 | -------------------------------------------------------------------------------- /go/graphd/test/fake_test.go: -------------------------------------------------------------------------------- 1 | package fakegraphd 2 | 3 | import ( 4 | "bufio" 5 | "fmt" 6 | "log" 7 | "net" 8 | "os" 9 | "testing" 10 | ) 11 | 12 | const addr = ":8081" 13 | 14 | var fg *FakeGraphd 15 | 16 | func TestFakeReply(t *testing.T) { 17 | want := "ok ()\n" 18 | fg.SetReply(want) 19 | conn, err := net.Dial("tcp", addr) 20 | if err != nil { 21 | t.Errorf("Error connecting to fakegraphd: %v", err) 22 | } 23 | fmt.Fprintf(conn, "status ()\n") 24 | r := bufio.NewReader(conn) 25 | got, err := r.ReadString('\n') 26 | if err != nil { 27 | t.Errorf("Unexpected error reading response: %v", err) 28 | } 29 | if got != want { 30 | t.Errorf("Unexpected reply after SetReply, got = %v, want = %v", got, want) 31 | } 32 | } 33 | 34 | func TestMain(m *testing.M) { 35 | fg = New(addr) 36 | cleanup, err := fg.Start() 37 | defer cleanup() 38 | if err != nil { 39 | log.Fatalf("Unexpected error starting fake graphd: %v", err) 40 | } 41 | os.Exit(m.Run()) 42 | } 43 | -------------------------------------------------------------------------------- /graphd/graphd-ast.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Google Inc. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | Unless required by applicable law or agreed to in writing, software 8 | distributed under the License is distributed on an "AS IS" BASIS, 9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | #ifndef __GRAPHD_AST__ 14 | #define __GRAPHD_AST__ 15 | 16 | #include "libgdp/gdp.h" 17 | 18 | // TODO: Needs documentation. 19 | extern int graphd_ast_parse(graphd_request *greq); 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /graphd/graphd-build-version.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Google Inc. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | Unless required by applicable law or agreed to in writing, software 8 | distributed under the License is distributed on an "AS IS" BASIS, 9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | char const graphd_build_version[] = "eternal"; 14 | -------------------------------------------------------------------------------- /graphd/graphd-cancel.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Google Inc. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | Unless required by applicable law or agreed to in writing, software 8 | distributed under the License is distributed on an "AS IS" BASIS, 9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | #include "graphd/graphd.h" 14 | 15 | #include 16 | #include 17 | #include 18 | 19 | /* Mark an ongoing request as cancelled. 20 | */ 21 | 22 | int graphd_cancel(graphd_handle* g, graphd_request* greq) { return 0; } 23 | -------------------------------------------------------------------------------- /graphd/graphd-snapshot.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Google Inc. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | Unless required by applicable law or agreed to in writing, software 8 | distributed under the License is distributed on an "AS IS" BASIS, 9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | #ifndef GRAPHD_SNAPSHOT_H 14 | #define GRAPHD_SNAPSHOT_H 1 15 | 16 | #include "graphd/graphd.h" 17 | 18 | int graphd_snapshot_restore(graphd_handle* g, srv_handle* srv, 19 | graphd_database_config const* dcf); 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /graphd/graphd-text-compare.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Google Inc. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | Unless required by applicable law or agreed to in writing, software 8 | distributed under the License is distributed on an "AS IS" BASIS, 9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | #include "graphd/graphd.h" 14 | 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | int graphd_text_compare(const char* a_s, const char* a_e, const char* b_s, 21 | const char* b_e) { 22 | int i; 23 | 24 | i = graph_fuzzycmp(a_s, a_e, b_s, b_e); 25 | 26 | return i; 27 | } 28 | -------------------------------------------------------------------------------- /libaddb/.cvsignore: -------------------------------------------------------------------------------- 1 | obj.* -------------------------------------------------------------------------------- /libaddb/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | libaddb 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /libaddb/README: -------------------------------------------------------------------------------- 1 | libaddb.a - a simple file-based datab-oh, look, a squirrel! 2 | 3 | Until something better comes up, libaddb.a is the "work horse" 4 | of the graph repository - a library that stores things, or 5 | stores mappings between things, with a minimum of fuss. 6 | 7 | Services: 8 | 9 | - istore: map 34-bit integers to dynamically-sized, 10 | fairly small chunks of data that are never deleted. 11 | Allocate new chunks; look up a chunk for an index; 12 | iterate over all chunks in the database. 13 | 14 | - gmap: map 34-bit integers to lists of other 34-bit 15 | integers. Only supported operations are "append" 16 | and "iterate"; no built-in uniqueness protection. 17 | 18 | - flat: read and write a flat file. 19 | 20 | Tools: 21 | addb -- text interpreter front-end to addb interface functions 22 | addbdump -- dump contents of one addb file. 23 | 24 | Used by: 25 | Graph database, via libpdb. 26 | 27 | Implemented in: 28 | C 29 | -------------------------------------------------------------------------------- /libaddb/addb-build-version.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Google Inc. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | Unless required by applicable law or agreed to in writing, software 8 | distributed under the License is distributed on an "AS IS" BASIS, 9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | char const addb_build_version[] = "eternal"; 15 | -------------------------------------------------------------------------------- /libaddb/addb-largefile-file.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Google Inc. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | Unless required by applicable law or agreed to in writing, software 8 | distributed under the License is distributed on an "AS IS" BASIS, 9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | #ifndef ADDB_BIGFILE_FILE_H 14 | #define ADDB_BIGFILE_FILE_H 15 | 16 | #include "libaddb/addb-scalar.h" 17 | 18 | #define ADDB_LARGE_HEADER 80 19 | #define ADDB_LARGE_MAGIC "lfv3" 20 | 21 | /* 22 | * This header lives at the begining of every large file. 23 | */ 24 | typedef struct { 25 | addb_u4 lhr_magic; 26 | addb_u8 lhr_size; 27 | 28 | } addb_large_header; 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /libcl/.cvsignore: -------------------------------------------------------------------------------- 1 | obj.* 2 | .project 3 | cl-build-version.c 4 | -------------------------------------------------------------------------------- /libcl/cl-abort-c.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Google Inc. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | Unless required by applicable law or agreed to in writing, software 8 | distributed under the License is distributed on an "AS IS" BASIS, 9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | #include "libcl/clp.h" 14 | 15 | #include 16 | #include 17 | #include 18 | 19 | 20 | void cl_abort_c(void *p) { abort(); } 21 | -------------------------------------------------------------------------------- /libcl/cl-build-version.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Google Inc. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | Unless required by applicable law or agreed to in writing, software 8 | distributed under the License is distributed on an "AS IS" BASIS, 9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | char const cl_build_version[] = "eternal"; 15 | -------------------------------------------------------------------------------- /libcl/cl-set-stacktrace.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Google Inc. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | Unless required by applicable law or agreed to in writing, software 8 | distributed under the License is distributed on an "AS IS" BASIS, 9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | #include "libcl/clp.h" 14 | 15 | int cl_set_stacktrace(cl_handle* cl, bool wantstack) { 16 | cl->cl_stacktrace = wantstack; 17 | 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /libcl/cl-strerror.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Google Inc. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | Unless required by applicable law or agreed to in writing, software 8 | distributed under the License is distributed on an "AS IS" BASIS, 9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | #include "libcl/clp.h" 14 | 15 | #include 16 | 17 | char const* cl_strerror(cl_handle* cl, int err) { 18 | if (cl == NULL || cl->cl_strerror == NULL) return strerror(err); 19 | 20 | return cl->cl_strerror(cl->cl_strerror_data, err); 21 | } 22 | -------------------------------------------------------------------------------- /libcm/.cvsignore: -------------------------------------------------------------------------------- 1 | obj.* 2 | .project 3 | cm-build-version.c 4 | -------------------------------------------------------------------------------- /libcm/BUILD: -------------------------------------------------------------------------------- 1 | # Description: 2 | # libcm - a memory allocation framework. 3 | 4 | package(default_visibility = ["//visibility:public"]) 5 | 6 | cc_library( 7 | name = "libcm", 8 | srcs = [ 9 | "cm-argv.c", 10 | "cm-buffer.c", 11 | "cm-build-version.c", 12 | "cm-c.c", 13 | "cm-error.c", 14 | "cm-hash.c", 15 | "cm-heap.c", 16 | "cm-list.c", 17 | "cm-malcpy.c", 18 | "cm-prefix.c", 19 | "cm-resource.c", 20 | "cm-runtime-statistics.c", 21 | "cm-sprintf.c", 22 | "cm-substr.c", 23 | "cm-trace.c", 24 | "cm-zalloc.c", 25 | ], 26 | hdrs = ["cm.h"], 27 | copts = ["-g"], 28 | ) 29 | -------------------------------------------------------------------------------- /libcm/cm-build-version.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Google Inc. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | Unless required by applicable law or agreed to in writing, software 8 | distributed under the License is distributed on an "AS IS" BASIS, 9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | char const cm_build_version[] = "eternal"; 15 | -------------------------------------------------------------------------------- /libcm/cm-zalloc.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Google Inc. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | Unless required by applicable law or agreed to in writing, software 8 | distributed under the License is distributed on an "AS IS" BASIS, 9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | #include "libcm/cm.h" 14 | #include 15 | 16 | void *cm_zalloc_loc(cm_handle *cm, size_t size, char const *file, int line) { 17 | void *ptr; 18 | 19 | ptr = (*cm->cm_realloc_loc)(cm, NULL, size, file, line); 20 | if (ptr != NULL) memset(ptr, 0, size); 21 | return ptr; 22 | } 23 | -------------------------------------------------------------------------------- /libes/.cvsignore: -------------------------------------------------------------------------------- 1 | obj.* 2 | .project -------------------------------------------------------------------------------- /libes/BUILD: -------------------------------------------------------------------------------- 1 | # Description: 2 | # es - This is poll(2) on steroids. 3 | 4 | package(default_visibility = ["//visibility:public"]) 5 | 6 | cc_library( 7 | name = "libes", 8 | srcs = [ 9 | "es-application-event.c", 10 | "es-build-version.c", 11 | "es-close.c", 12 | "es-create.c", 13 | "es-demon.c", 14 | "es-destroy.c", 15 | "es-idle.c", 16 | "es-loop.c", 17 | "es-now.c", 18 | "es-open.c", 19 | "es-set-post-dispatch.c", 20 | "es-set-pre-dispatch.c", 21 | "es-subscribe.c", 22 | "es-timeout.c", 23 | "es-unsubscribe.c", 24 | "esp.h", 25 | ], 26 | hdrs = ["es.h"], 27 | copts = ["-g"], 28 | deps = [ 29 | "//libcl", 30 | "//libcm", 31 | ], 32 | ) 33 | -------------------------------------------------------------------------------- /libes/README: -------------------------------------------------------------------------------- 1 | es -- event server 2 | 3 | This is poll(2) on steroids. 4 | 5 | Poll events -- incoming data, outgoing capacity, 6 | errors, timeouts -- are dispatched to handlers. 7 | There's one handler per file descriptor. 8 | Handlers can subscribe to and unsubscribe 9 | from events, and can hook up to at most one 10 | timeout per handler. 11 | 12 | USES 13 | cl for logging, assertions 14 | cm for allocation 15 | 16 | USED-BY 17 | graphd 18 | 19 | TIMEOUTS 20 | Timeouts are allocated as separate objects 21 | and explicitly associated with sessions. 22 | 23 | THREADING 24 | The library is implicitly single-threaded. 25 | I.e. it doesn't interfere with threads in the 26 | back, but there's only one thread calling 27 | poll() at any one time. 28 | Caller locks if they need to. 29 | 30 | -------------------------------------------------------------------------------- /libes/es-build-version.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Google Inc. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | Unless required by applicable law or agreed to in writing, software 8 | distributed under the License is distributed on an "AS IS" BASIS, 9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | char const es_build_version[] = "eternal"; 15 | 16 | -------------------------------------------------------------------------------- /libgdp/BUILD: -------------------------------------------------------------------------------- 1 | # Description: 2 | # gdp - graph language parser 3 | 4 | package( 5 | default_visibility = ["//visibility:public"], 6 | ) 7 | 8 | cc_library( 9 | name = "libgdp", 10 | srcs = [ 11 | "gdp.c", 12 | "gdp-input.c", 13 | "gdp-lexer.c", 14 | "gdp-micro.c", 15 | "gdp-parse.c", 16 | "gdp-private.h", 17 | "gdp-token.c", 18 | ], 19 | hdrs = [ 20 | "gdp.h", 21 | "gdp-error.h", 22 | "gdp-input.h", 23 | "gdp-lexer.h", 24 | "gdp-micro.h", 25 | "gdp-misc.h", 26 | "gdp-output.h", 27 | "gdp-token.h", 28 | ], 29 | copts = ["-g"], 30 | deps = [ 31 | "//graphd:graphdh", 32 | "//libaddb", 33 | "//libcl", 34 | "//libcm", 35 | "//libes", 36 | "//libgraph", 37 | "//libpdb", 38 | "//libsrv", 39 | ], 40 | ) 41 | -------------------------------------------------------------------------------- /libgdp/grammar.awk: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | BEGIN { FS = " *<-- *" } 16 | { printf "%24s <-- %s\n",$1,$2 } 17 | -------------------------------------------------------------------------------- /libgdp/grammar.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2015 Google Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | # Print graphd grammar. 17 | 18 | grep '<--' gdp-parse.c | colrm 1 3 | awk -f grammar.awk 19 | -------------------------------------------------------------------------------- /libgraph/.cvsignore: -------------------------------------------------------------------------------- 1 | obj.* 2 | .project 3 | graph-build-version.c 4 | -------------------------------------------------------------------------------- /libgraph/README: -------------------------------------------------------------------------------- 1 | libgraph.a - graph repository basic data types 2 | 3 | This abstracts out little data types like a GUID 4 | or a timestamp, for use by applications and 5 | semantic server parts, without knowing anything 6 | about, or touching on, requests or transport. 7 | 8 | Services: 9 | - graph_guid and accessor functions 10 | - graph_timestamp_t and accessors 11 | - graph_set (set of GUIDs) and accessors [still in development] 12 | - datatype names 13 | 14 | Other Things You May Be Looking For When Reading This: 15 | 16 | ... the graph repository server program code? 17 | ../graph/src 18 | 19 | ... the graph repository client library? 20 | ../libgraphdb 21 | 22 | ... low level database code? 23 | ../libpdb 24 | 25 | ... *really* low level database code? 26 | ../libaddb 27 | 28 | Used by: 29 | graph, graphdb 30 | 31 | Implemented in: 32 | C 33 | -------------------------------------------------------------------------------- /libgraph/graph-build-version.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Google Inc. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | Unless required by applicable law or agreed to in writing, software 8 | distributed under the License is distributed on an "AS IS" BASIS, 9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | 14 | char const graph_build_version[] = "eternal"; 15 | -------------------------------------------------------------------------------- /libgraph/graph-destroy.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Google Inc. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | Unless required by applicable law or agreed to in writing, software 8 | distributed under the License is distributed on an "AS IS" BASIS, 9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | #include "libgraph/graphp.h" 14 | 15 | /** 16 | * @brief Destroy a graph module handle. 17 | * @param graph NULL or a graph module handle allocated with graph_create(). 18 | */ 19 | void graph_destroy(graph_handle *graph) { 20 | if (!graph) return; 21 | cl_cover(graph->graph_cl); 22 | 23 | cm_free(graph->graph_cm, graph); 24 | } 25 | -------------------------------------------------------------------------------- /libgraph/graphdateline: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | DIRPATH=${0%/*} 4 | eval `cd "$DIRPATH"; make --no-print-directory obj-export` 5 | exec "$DIRPATH"/${OBJ}/graphdateline "$@" 6 | -------------------------------------------------------------------------------- /libgraph/graphdbid: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | DIRPATH=${0%/*} 4 | eval `cd "$DIRPATH"; make --no-print-directory obj-export` 5 | exec "$DIRPATH"/"${OBJ}"/"${0/**\//}" "$@" 6 | -------------------------------------------------------------------------------- /libgraph/graphguid: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIRPATH=${0%/*} 4 | eval `cd "$DIRPATH"; make --no-print-directory obj-export` 5 | exec "$DIRPATH"/"${OBJ}"/"${0//**\//}" "$@" 6 | -------------------------------------------------------------------------------- /libgraph/graphhullset: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | DIRPATH=${0%/*} 4 | eval `cd "$DIRPATH"; make --no-print-directory obj-export` 5 | exec "$DIRPATH"/${OBJ}/graphhullset "$@" 6 | -------------------------------------------------------------------------------- /libgraph/graphtimestamp: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | DIRPATH=${0%/*} 4 | eval `cd "$DIRPATH"; make --no-print-directory obj-export` 5 | exec "$DIRPATH"/${OBJ}/graphtimestamp "$@" 6 | -------------------------------------------------------------------------------- /libgraphdb/.cvsignore: -------------------------------------------------------------------------------- 1 | obj.* 2 | .project 3 | graphdb-build-version.c 4 | -------------------------------------------------------------------------------- /libgraphdb/README: -------------------------------------------------------------------------------- 1 | libgraphdb.a - C graph repository client library 2 | 3 | Services: 4 | - connect to graph database servers, 5 | failing over transparently among multiple access points 6 | - construct graphs 7 | - execute queries against graphs 8 | 9 | Documentation: 10 | HTML -- doc/html/graphdb_8h.html 11 | man -- doc/man/man3/graphdb.h.3 12 | 13 | To refresh the documentation, have doxygen 1.4.2 or better 14 | installed and run "make docs". 15 | 16 | Used by: 17 | little maintenance and load scripts, once it's finished 18 | 19 | Sample Applications: 20 | graphdb-to-dot -- turn results of a graphdb query into 21 | graphviz ".dot" input. 22 | Implemented in: 23 | C 24 | -------------------------------------------------------------------------------- /libgraphdb/graphdb-build-version.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Google Inc. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | Unless required by applicable law or agreed to in writing, software 8 | distributed under the License is distributed on an "AS IS" BASIS, 9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | char const graphdb_build_version[] = "eternal"; 14 | -------------------------------------------------------------------------------- /libgraphdb/graphdb-time.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Google Inc. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | Unless required by applicable law or agreed to in writing, software 8 | distributed under the License is distributed on an "AS IS" BASIS, 9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | #include "libgraphdb/graphdbp.h" 14 | 15 | #include 16 | 17 | unsigned long long graphdb_time_millis(void) { 18 | struct timeval tv; 19 | 20 | gettimeofday(&tv, (struct timezone *)NULL); 21 | 22 | return (unsigned long long)tv.tv_sec * 1000 + 23 | (unsigned long long)tv.tv_usec / 1000; 24 | } 25 | -------------------------------------------------------------------------------- /libpdb/.cvsignore: -------------------------------------------------------------------------------- 1 | obj.* 2 | .project -------------------------------------------------------------------------------- /libpdb/README: -------------------------------------------------------------------------------- 1 | libpdb.a - primitive database 2 | 3 | Layered on top of the "workhorse" libaddb.a, this library's 4 | goal is to present a user interface to the graphdb server process 5 | that makes sense of data in terms of "primitives" -- tuples of 6 | type, name, valuetype, value, scope, timestamp, etc. 7 | 8 | To libaddb, it's all just data. libpdb knows that bytes 16..31 9 | of this data are the big-endian GUID of a scope object. 10 | 11 | Much of libpdb is really not so much code as _conventions_; 12 | a lot of it is macros in pdb.h that access certain bytes in certain 13 | ways. 14 | 15 | Services: 16 | - read, allocate primitives; 17 | - iterate over all primitives in a database 18 | - remove a complete database 19 | 20 | Tools: 21 | pdbdump -- dump contents of one pdb database. 22 | 23 | Uses: 24 | libaddb, libgraph. 25 | 26 | Used by: 27 | Graph database 28 | 29 | Implemented in: 30 | C 31 | -------------------------------------------------------------------------------- /libpdb/pdb-build-version.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Google Inc. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | Unless required by applicable law or agreed to in writing, software 8 | distributed under the License is distributed on an "AS IS" BASIS, 9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | char const pdb_build_version[] = "eternal"; 14 | -------------------------------------------------------------------------------- /libpdb/pdb-database-id.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Google Inc. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | Unless required by applicable law or agreed to in writing, software 8 | distributed under the License is distributed on an "AS IS" BASIS, 9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | #include "libpdb/pdbp.h" 14 | 15 | unsigned long long pdb_database_id(pdb_handle* pdb) { 16 | return pdb ? pdb->pdb_database_id : 0; 17 | } 18 | -------------------------------------------------------------------------------- /libpdb/pdb-log.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Google Inc. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | Unless required by applicable law or agreed to in writing, software 8 | distributed under the License is distributed on an "AS IS" BASIS, 9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | #include "libpdb/pdbp.h" 14 | 15 | #include 16 | #include 17 | 18 | #include "libcl/cl.h" 19 | #include "libcm/cm.h" 20 | 21 | /** 22 | * @brief Return the log handle that a PDB handle logs through. 23 | * @param pdb NULL or a PDB handle 24 | * @return NULL or the pdb's cl_handle object. 25 | */ 26 | cl_handle* pdb_log(pdb_handle* pdb) { return pdb ? pdb->pdb_cl : NULL; } 27 | -------------------------------------------------------------------------------- /libpdb/pdb-mem.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Google Inc. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | Unless required by applicable law or agreed to in writing, software 8 | distributed under the License is distributed on an "AS IS" BASIS, 9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | #include "libpdb/pdbp.h" 14 | 15 | #include 16 | #include 17 | 18 | #include "libcl/cl.h" 19 | #include "libcm/cm.h" 20 | 21 | /** 22 | * @brief Return the memory handle that a PDB allocates through. 23 | * @param pdb NULL or a PDB handle 24 | * @return NULL or the pdb's cm_handle object. 25 | */ 26 | cm_handle* pdb_mem(pdb_handle* pdb) { return pdb ? pdb->pdb_cm : NULL; } 27 | -------------------------------------------------------------------------------- /libpdb/pdb-msclock.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Google Inc. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | Unless required by applicable law or agreed to in writing, software 8 | distributed under the License is distributed on an "AS IS" BASIS, 9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | #include "libpdb/pdbp.h" 14 | 15 | /** 16 | * @brief What's the current millisecond? 17 | * @param pdb Module handle allocated with pdb_create() 18 | * @return The current millisecond, for use in deadline 19 | * calculations. 20 | */ 21 | pdb_msclock_t pdb_msclock(pdb_handle *pdb) { 22 | return addb_msclock(pdb->pdb_addb); 23 | } 24 | -------------------------------------------------------------------------------- /libpdb/pdb-primitive-initialize.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Google Inc. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | Unless required by applicable law or agreed to in writing, software 8 | distributed under the License is distributed on an "AS IS" BASIS, 9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | #include "libpdb/pdbp.h" 14 | 15 | /* Make sure that a primitive cannot be misunderstood as a reference. 16 | */ 17 | 18 | void pdb_primitive_initialize(pdb_primitive* pr) { 19 | if (pr != NULL) { 20 | pr->pr_data.data_type = ADDB_DATA_NONE; 21 | pr->pr_data.data_memory = NULL; 22 | pr->pr_data.data_size = 0; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /libpdb/pdb-primitive-n.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Google Inc. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | Unless required by applicable law or agreed to in writing, software 8 | distributed under the License is distributed on an "AS IS" BASIS, 9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | #include "libpdb/pdbp.h" 14 | 15 | /* How many primitives are there in this database? 16 | */ 17 | unsigned long long pdb_primitive_n(pdb_handle* pdb) { 18 | if (pdb && pdb->pdb_primitive) return addb_istore_next_id(pdb->pdb_primitive); 19 | 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /libpdb/pdb-set-database-id.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Google Inc. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | Unless required by applicable law or agreed to in writing, software 8 | distributed under the License is distributed on an "AS IS" BASIS, 9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | #include "libpdb/pdbp.h" 14 | 15 | #include 16 | 17 | int pdb_set_database_id(pdb_handle* pdb, unsigned long long id) { 18 | if (pdb == NULL) return EINVAL; 19 | pdb->pdb_database_id = id; 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /libpdb/pdb-set-predictable.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Google Inc. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | Unless required by applicable law or agreed to in writing, software 8 | distributed under the License is distributed on an "AS IS" BASIS, 9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | #include "libpdb/pdbp.h" 14 | 15 | void pdb_set_predictable(pdb_handle* pdb, bool is_predictable) { 16 | pdb->pdb_predictable = is_predictable; 17 | } 18 | -------------------------------------------------------------------------------- /libpdb/pdb-set-sync.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Google Inc. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | Unless required by applicable law or agreed to in writing, software 8 | distributed under the License is distributed on an "AS IS" BASIS, 9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | #include "libpdb/pdbp.h" 14 | 15 | void pdb_set_sync(pdb_handle* pdb, bool hard_sync) { 16 | pdb->pdb_cf.pcf_sync = hard_sync; 17 | } 18 | -------------------------------------------------------------------------------- /libsrv/.cvsignore: -------------------------------------------------------------------------------- 1 | obj.* 2 | .project -------------------------------------------------------------------------------- /libsrv/README: -------------------------------------------------------------------------------- 1 | libsrv.a - protocol server 2 | 3 | The non-protocol-specific trappings of a text-based protocol 4 | server (see the "uncopying server" paper in cvs:graph/gr-uncopying.txt). 5 | 6 | This is factored out in an attempt to later make it usable 7 | for other servers (and this module truly doesn't know a node 8 | from a hole in the ground), but it's still far from at the 9 | point where it's sensible or well structured -- don't bug 10 | me about it just now [Mar 2005]. 11 | 12 | Services: 13 | - pid-file allows external shutdown of server, locks 14 | - monitoring process restarts server thread after crash 15 | - configuration file defines interfaces for listening 16 | - command line arguments 17 | - loglevel set on command line or in configuration file 18 | - run as uid, gid instead of root 19 | 20 | Tested: 21 | Nowhere near enough. 22 | 23 | Used by: 24 | Graph database 25 | 26 | Implemented in: 27 | C 28 | -------------------------------------------------------------------------------- /libsrv/srv-build-version.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Google Inc. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | Unless required by applicable law or agreed to in writing, software 8 | distributed under the License is distributed on an "AS IS" BASIS, 9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | char const srv_build_version[] = "eternal"; 14 | -------------------------------------------------------------------------------- /libsrv/srv.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Google Inc. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | Unless required by applicable law or agreed to in writing, software 8 | distributed under the License is distributed on an "AS IS" BASIS, 9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | /* 14 | * srv.c -- test application main() 15 | */ 16 | 17 | #include "srvp.h" 18 | 19 | int main(int argc, char **argv) { return srv_main(argc, argv); } 20 | -------------------------------------------------------------------------------- /test/unit/.cvsignore: -------------------------------------------------------------------------------- 1 | *.time 2 | *.gmon 3 | *.out 4 | -------------------------------------------------------------------------------- /test/unit/033-1.out.exp: -------------------------------------------------------------------------------- 1 | ok dateline="0000001240003456800000000000000a" (00000012400034568000000000000009) 2 | ok dateline="0000001240003456800000000000000d" (0000001240003456800000000000000c) 3 | ok dateline="00000012400034568000000000000010" (0000001240003456800000000000000f) 4 | error EMPTY "not found" 5 | ok (("viola") ("harp")) 6 | -------------------------------------------------------------------------------- /test/unit/186.out.exp: -------------------------------------------------------------------------------- 1 | error SYNTAX "more than one value for \"type\"" 2 | -------------------------------------------------------------------------------- /test/unit/186.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | 21 | rm -rf $D 22 | rungraphd -d${D} -bty <<-'EOF' 23 | write (<- "xyz" RIgHt=0 "*b" (ScOpe =0 vAlue ="blah")) 24 | EOF 25 | rm -rf $D 26 | -------------------------------------------------------------------------------- /test/unit/3323.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | error EMPTY "not found" 3 | error EMPTY "not found" 4 | error EMPTY "not found" 5 | error EMPTY "not found" 6 | ok () 7 | ok () 8 | error SEMANTICS "left=ffffffffffffffffffffffffffffffff: not found" 9 | error SEMANTICS "left=0: not found" 10 | -------------------------------------------------------------------------------- /test/unit/3692.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok ("null:") 3 | error EMPTY "not found" 4 | ok ("null:") 5 | -------------------------------------------------------------------------------- /test/unit/5230.out.exp: -------------------------------------------------------------------------------- 1 | ok dateline="00000012400034568000000000000001" (00000012400034568000000000000000) 2 | ok dateline="00000012400034568000000000000002" (00000012400034568000000000000001) 3 | ok id="mand" "find me" 4 | ok id="mand<3" "find me" 5 | ok id="mand<2" "find me" 6 | error EMPTY id="mand<1" "not found" 7 | error EMPTY id="mand<0" "not found" 8 | ok id="opt" "find me" 9 | ok id="opt<2" "find me" 10 | ok id="opt<1" "find me" 11 | ok id="opt<0" "find me" 12 | -------------------------------------------------------------------------------- /test/unit/BUILD: -------------------------------------------------------------------------------- 1 | [ 2 | sh_test( 3 | name = test[0:-3], 4 | srcs = ["test.sh"], 5 | args = [ 6 | "-v", 7 | test, 8 | ], 9 | data = [ 10 | test, 11 | "rungraphd", 12 | "//graphd", 13 | "//util:gpush", 14 | "//gld", 15 | ] + glob([ 16 | "%s*.exp" % test[:-3], 17 | "%s*.in" % test[:3], 18 | "*.conf", 19 | ]), 20 | ) 21 | for test in glob(["*.sh"]) 22 | if test != "test.sh" 23 | ] 24 | -------------------------------------------------------------------------------- /test/unit/anchor2.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000 (00000012400034568000000000000003 (00000012400034568000000000000001) (00000012400034568000000000000002))) 2 | ok (00000012400034568000000000000004 (00000012400034568000000000000007 (00000012400034568000000000000005) (00000012400034568000000000000006))) 3 | error OUTDATED "\"00000012400034568000000000000000\" has been versioned" 4 | ok (00000012400034568000000000000004 (00000012400034568000000000000007 (00000012400034568000000000000005) (00000012400034568000000000000006))) 5 | -------------------------------------------------------------------------------- /test/unit/anchor3.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000 (00000012400034568000000000000003 (00000012400034568000000000000001) (00000012400034568000000000000002))) 2 | ok (00000012400034568000000000000000 (00000012400034568000000000000006 (00000012400034568000000000000004) (00000012400034568000000000000005))) 3 | ok (00000012400034568000000000000000 (00000012400034568000000000000006 (00000012400034568000000000000004) (00000012400034568000000000000005)) (00000012400034568000000000000009 (00000012400034568000000000000007) (00000012400034568000000000000008))) 4 | error EMPTY "anchor constraint not found" 5 | ok (0000001240003456800000000000000a (0000001240003456800000000000000d (0000001240003456800000000000000b) (0000001240003456800000000000000c))) 6 | -------------------------------------------------------------------------------- /test/unit/anchor4.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000 (00000012400034568000000000000001)) 2 | ok (00000012400034568000000000000004 (00000012400034568000000000000002 (00000012400034568000000000000003))) 3 | ok (00000012400034568000000000000005 (00000012400034568000000000000000 (00000012400034568000000000000001))) 4 | error EXISTS "primitive tagged as unique already exist" 5 | -------------------------------------------------------------------------------- /test/unit/atleast.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000009) 2 | ok (0000001240003456800000000000000c) 3 | ok ((0000001240003456800000000000000c "vegetable" null null null null true true 1970-01-01T00:00:00.0012Z)) 4 | -------------------------------------------------------------------------------- /test/unit/atleast.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bty <<-'EOF' 22 | write (type="animal") 23 | write (type="vegetable") 24 | read (type="vegetable" atleast=0) 25 | EOF 26 | rm -rf $D 27 | -------------------------------------------------------------------------------- /test/unit/ben.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bty < ben.in 22 | rungraphd -d${D} -bty <<-'EOF' 23 | read (value="monopoly") 24 | EOF 25 | rm -rf $D 26 | -------------------------------------------------------------------------------- /test/unit/ben2.in: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/graphd/e994e8852306aef7c02eb68c4f6d6f4d396a54be/test/unit/ben2.in -------------------------------------------------------------------------------- /test/unit/ben2.out.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/graphd/e994e8852306aef7c02eb68c4f6d6f4d396a54be/test/unit/ben2.out.exp -------------------------------------------------------------------------------- /test/unit/ben2.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bty < ben2.in 22 | rungraphd -d${D} -bty -v fail <<-'EOF' 23 | read (left=null pagesize=10000) 24 | EOF 25 | rm -rf $D 26 | -------------------------------------------------------------------------------- /test/unit/ben5.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bty < ben2.in 22 | rungraphd -d${D} -bty <<-'EOF' 23 | read (left=null pagesize=12) 24 | EOF 25 | rm -rf $D 26 | -------------------------------------------------------------------------------- /test/unit/bendump.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bty < ben.in 22 | rungraphd -d${D} -bty <<-'EOF' 23 | dump () 24 | EOF 25 | rm -rf $D 26 | -------------------------------------------------------------------------------- /test/unit/benrestore.out.exp: -------------------------------------------------------------------------------- 1 | ok 2 | ok ((000000124000345680000000000012a3 "metaweb.0.1.string" null string "Monopoly" null true true 1970-01-01T00:00:00.4771Z)) 3 | -------------------------------------------------------------------------------- /test/unit/big.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | error TOOBIG "primitive too big" 3 | error TOOBIG "name too long" 4 | -------------------------------------------------------------------------------- /test/unit/big1.out.exp: -------------------------------------------------------------------------------- 1 | error TOOBIG "primitive too big" 2 | error TOOBIG "name too long" 3 | ok (00000012400034568000000000000009) 4 | -------------------------------------------------------------------------------- /test/unit/bigconf.conf: -------------------------------------------------------------------------------- 1 | log-level fatal 2 | pid-file bigconf.conf 3 | log-facility local3 4 | log-file blah 5 | pool-min 12 6 | pool-max 1k 7 | pool-page-size 2k 8 | -------------------------------------------------------------------------------- /test/unit/bigconf.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -f ./bigconf.conf -bty <<-'EOF' 22 | EOF 23 | rm -rf $D 24 | -------------------------------------------------------------------------------- /test/unit/brendan1.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bty <<-'EOF' 22 | write ("truth" 23 | (<- "eq" ("b" (<- "eq" ("beauty")))) 24 | (<- "eq" ("time" (<- "eq" ("money"))))) 25 | read ((<- "eq")) 26 | EOF 27 | rm -rf $D 28 | -------------------------------------------------------------------------------- /test/unit/brendan2.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000009 (0000001240003456800000000000000c (0000001240003456800000000000000d))) 2 | error SEMANTICS "on line 1, column 34: ')': unknown subconstraint linkage" 3 | -------------------------------------------------------------------------------- /test/unit/brendan2.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bty <<-'EOF' 22 | write ("parent" (<- "child-of" (<- "child-of"))) 23 | write ("parent" ("child" ("child"))) 24 | EOF 25 | rm -rf $D 26 | -------------------------------------------------------------------------------- /test/unit/brendan4.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000009 (0000001240003456800000000000000f (0000001240003456800000000000000e)) (00000012400034568000000000000011 (00000012400034568000000000000010))) 2 | ok "cursor:48da:[o:1][n:10]gmap:9-10:t->7/1/" 3 | error EMPTY "not found" 4 | -------------------------------------------------------------------------------- /test/unit/bug5473.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok ((00000012400034568000000000000000 null null string "mw740108221438" null true true 1970-01-01T00:00:00.0000Z)) 3 | ok ((00000012400034568000000000000000 null null string "mw740108221438" null true true 1970-01-01T00:00:00.0000Z)) 4 | -------------------------------------------------------------------------------- /test/unit/bug5473.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bty <<-'EOF' 22 | write (value="mw740108221438") 23 | read (value="mw740108221438") 24 | read (value~="mw740108221438") 25 | EOF 26 | rm -rf $D 27 | -------------------------------------------------------------------------------- /test/unit/byguid.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000009) 2 | ok ((00000012400034568000000000000009 "animal" null null null null true true 1970-01-01T00:00:00.0009Z)) 3 | -------------------------------------------------------------------------------- /test/unit/byguid.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bty <<-'EOF' 22 | write (type="animal") 23 | read (guid=00000012400034568000000000000009) 24 | EOF 25 | rm -rf $D 26 | -------------------------------------------------------------------------------- /test/unit/camera.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000009 (0000001240003456800000000000000c) (0000001240003456800000000000000f)) 2 | ok (00000012400034568000000000000010 (00000012400034568000000000000011) (00000012400034568000000000000012)) 3 | ok (00000012400034568000000000000013 (00000012400034568000000000000014) (00000012400034568000000000000015)) 4 | ok (00000012400034568000000000000016 (00000012400034568000000000000017) (00000012400034568000000000000018)) 5 | ok (00000012400034568000000000000019 (0000001240003456800000000000001a) (0000001240003456800000000000001b)) 6 | ok (0000001240003456800000000000001c (0000001240003456800000000000001d) (0000001240003456800000000000001e)) 7 | ok (0000001240003456800000000000001f (00000012400034568000000000000020) (00000012400034568000000000000021)) 8 | ok (("Canon PowerShot A540") ("Canon PowerShot A620")) 9 | -------------------------------------------------------------------------------- /test/unit/cannotmatch.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000009) 2 | error SEMANTICS "on line 1, column 11: '~=': operator can only be used with 'value' constraints" 3 | error SEMANTICS "on line 1, column 11: '~=': operator can only be used with 'value' constraints" 4 | -------------------------------------------------------------------------------- /test/unit/cannotmatch.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bty <<-'EOF' 22 | write (type="fruitbat" name="flappie") 23 | read (type~="fruit*") 24 | read (name~="flap*") 25 | EOF 26 | rm -rf $D 27 | -------------------------------------------------------------------------------- /test/unit/cant-write-pid.err.exp: -------------------------------------------------------------------------------- 1 | ERROR: graphd: cannot create or open temporary pid-file "cant-write-pid-fneep/kaboodle.pid-NNN": No such file or directory 2 | Stacktrace: graphd[NNNx4dee54], srv_pidfile_create+140, srv_main+3589 3 | ERROR: graphd: cannot create or open temporary pid-file "cant-write-pid-fneep/kaboodle.pid-NNN": Permission denied 4 | Stacktrace: graphd[NNNx4dee54], srv_pidfile_create+140, srv_main+3589 5 | -------------------------------------------------------------------------------- /test/unit/chris1.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000009 (0000001240003456800000000000000d (0000001240003456800000000000000c))) 2 | ok ((00000012400034568000000000000009 "a" null null null null true true 1970-01-01T00:00:00.0009Z ((<- 0000001240003456800000000000000d null null null null null true true 1970-01-01T00:00:00.0013Z 00000012400034568000000000000009 0000001240003456800000000000000c ((0000001240003456800000000000000c "b" null null null null true true 1970-01-01T00:00:00.0012Z)))))) 3 | -------------------------------------------------------------------------------- /test/unit/chris1.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bty <<-'EOF' 22 | write ("a" (<- ("b"))) 23 | read ("a" (<- (any))) 24 | EOF 25 | rm -rf $D 26 | -------------------------------------------------------------------------------- /test/unit/chris2.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bt -p${B}.pid -y < chris2.in 22 | rm -rf $D 23 | -------------------------------------------------------------------------------- /test/unit/chris3.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000009 (0000001240003456800000000000000f (0000001240003456800000000000000e)) (00000012400034568000000000000011 (00000012400034568000000000000010)) (00000012400034568000000000000013 (00000012400034568000000000000012)) (00000012400034568000000000000019 (00000012400034568000000000000018))) 2 | ok 4 3 | -------------------------------------------------------------------------------- /test/unit/chris4.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000009 (0000001240003456800000000000000a)) 2 | ok ((00000012400034568000000000000009 "animal" null null null null true true 1970-01-01T00:00:00.0009Z)) 3 | -------------------------------------------------------------------------------- /test/unit/chris4.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bty <<-'EOF' 22 | write (type="animal" (-> right=null)) 23 | read ("animal") 24 | EOF 25 | rm -rf $D 26 | -------------------------------------------------------------------------------- /test/unit/chris6.out.exp: -------------------------------------------------------------------------------- 1 | ok 2 | ok ((0100007f400034c2800000000000009c null null null null null true true 2006-01-25T02:03:12.0003Z ((-> 0100007f400034c2800000000000009f "#0100007f400034c28000000000000008" null string "Shimmer" null true true 2006-01-25T02:03:12.0006Z 0100007f400034c28000000000000024 0100007f400034c2800000000000009c) (-> 0100007f400034c280000000000000a0 "#0100007f400034c28000000000000008" null string "Miroitement" null true true 2006-01-25T02:03:12.0007Z 0100007f400034c28000000000000099 0100007f400034c2800000000000009c)))) 3 | -------------------------------------------------------------------------------- /test/unit/chris7.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000 (00000012400034568000000000000001)) 2 | ok (00000012400034568000000000000002 (00000012400034568000000000000003)) 3 | ok (00000012400034568000000000000002) 4 | ok ((-> 00000012400034568000000000000003 null "new" string "foo" null true true 1970-01-01T00:00:00.0003Z 00000012400034568000000000000002 null ((00000012400034568000000000000002 null "new" null null null true true 1970-01-01T00:00:00.0002Z)))) 5 | -------------------------------------------------------------------------------- /test/unit/colors.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok (00000012400034568000000000000001) 3 | ok (00000012400034568000000000000002) 4 | ok (00000012400034568000000000000003) 5 | ok (00000012400034568000000000000004) 6 | ok (00000012400034568000000000000005) 7 | ok (00000012400034568000000000000006) 8 | ok (00000012400034568000000000000007) 9 | ok (00000012400034568000000000000008) 10 | ok (("this is blue") ("blue this is") ("this blue is") ("blue")) 11 | -------------------------------------------------------------------------------- /test/unit/comments.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000001 (00000012400034568000000000000000)) 2 | ok (0000001240003456800000000000000b) 3 | ok (0000001240003456800000000000000c) 4 | ok ((0000001240003456800000000000000c null null string "(:222:)" null true true 1970-01-01T00:00:00.0012Z)) 5 | ok ((-> 00000012400034568000000000000001 null null string "foo" null true true 1970-01-01T00:00:00.0001Z null 00000012400034568000000000000000)) 6 | ok ((-> 0000001240003456800000000000000a "has_key" null string "bam" 00000012400034568000000000000002 true true 1970-01-01T00:00:00.0010Z 00000012400034568000000000000009 00000012400034568000000000000003)) 7 | error SEMANTICS "on line 1, column 7: 'val': invalid constraint" 8 | ok () 9 | ok () 10 | ok ((0000001240003456800000000000000b "bam" null null null null true true 1970-01-01T00:00:00.0011Z)) 11 | -------------------------------------------------------------------------------- /test/unit/compare1.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok (00000012400034568000000000000001) 3 | ok (00000012400034568000000000000002) 4 | ok (00000012400034568000000000000003) 5 | ok (00000012400034568000000000000004) 6 | ok (00000012400034568000000000000005) 7 | ok (00000012400034568000000000000006) 8 | ok (00000012400034568000000000000007) 9 | ok id="0 00 000 0.0 0.0000" (("0") ("00") ("000") ("0.0") ("0.0000")) 10 | ok id="0 00 000 0.0 0.0000" (("0") ("00") ("000") ("0.0") ("0.0000")) 11 | ok id="0 00 000 0.0 0.0000" (("0") ("00") ("000") ("0.0") ("0.0000")) 12 | ok id="0 00 000 0.0 0.0000" (("0") ("00") ("000") ("0.0") ("0.0000")) 13 | ok id="0 00 000 0.0 0.0000 0.1.0" (("0") ("00") ("000") ("0.0") ("0.0000") ("0.1.0")) 14 | ok id="0" (("0")) 15 | ok id="000" (("000")) 16 | ok id="1.0 0.1.0 01.000" (("1.0") ("0.1.0") ("01.000")) 17 | ok id="1.0 01.000" (("01.000") ("1.0")) 18 | -------------------------------------------------------------------------------- /test/unit/compare2.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok (00000012400034568000000000000001) 3 | ok (00000012400034568000000000000002) 4 | ok (00000012400034568000000000000003) 5 | ok (00000012400034568000000000000004) 6 | ok (00000012400034568000000000000005) 7 | ok (00000012400034568000000000000006) 8 | ok (00000012400034568000000000000007) 9 | ok (00000012400034568000000000000008) 10 | ok (("-2") ("-1") ("0") ("1") ("1.5dollar") ("1.5") ("2") ("1dollar") ("five")) 11 | -------------------------------------------------------------------------------- /test/unit/cost1.out.exp: -------------------------------------------------------------------------------- 1 | ok ("") 2 | error SEMANTICS "cannot parse cost string \"dr=1 dw=2 tu=3 tr=4 ts=5 va=6 ir=7 iw=8 in=9 pf=10 pr=11 fm=12 mm=13 ft=14 mt=15\"" 3 | ok ("") 4 | error SEMANTICS "cannot parse cost string \"dr=1 tu=3 ts=5 ir=7 in=9 pr=11 mm=13 mt=15\"" 5 | ok ("") 6 | error SEMANTICS "cannot parse cost string \"falafel=$3.50\"" 7 | ok ("") 8 | -------------------------------------------------------------------------------- /test/unit/cost2.broken.conf: -------------------------------------------------------------------------------- 1 | cost { 2 | falafel 1 3 | rhubarb 2 4 | } 5 | -------------------------------------------------------------------------------- /test/unit/cost2.conf: -------------------------------------------------------------------------------- 1 | cost { 2 | dr 1 3 | dw 2 4 | tu 3 5 | tr 4 6 | ts 5 7 | va 6 8 | ir 7 9 | iw 8 10 | in 9 11 | pf 10 12 | pr 11 13 | } 14 | -------------------------------------------------------------------------------- /test/unit/cost2.err.exp: -------------------------------------------------------------------------------- 1 | ERROR: configuration file "cost2.broken.conf", line 2: "cost": unknown cost abbreviation "falafel", known: tr tu ts te pr pf dr dw ir iw in va fm mm ft mt 2 | ERROR: configuration file "cost2.short.broken.conf", line 1: don't understand "falafel" 3 | -------------------------------------------------------------------------------- /test/unit/cost2.out.exp: -------------------------------------------------------------------------------- 1 | ok ("") 2 | ok 3 | ok ("ts=5 tu=3 pr=11 dr=1 ir=7 in=9") 4 | error SEMANTICS "cannot parse cost string \"falafel=$3.50\"" 5 | ok ("ts=5 tu=3 pr=11 dr=1 ir=7 in=9") 6 | ok ("") 7 | -------------------------------------------------------------------------------- /test/unit/cost2.short.broken.conf: -------------------------------------------------------------------------------- 1 | cost "falafel=1 rhubarb=2" 2 | -------------------------------------------------------------------------------- /test/unit/cost2.short.conf: -------------------------------------------------------------------------------- 1 | cost "dr=1 dw=2 tu=3 tr=4 ts=5 va=6 ir=7 iw=8 in=9 pf=10 pr=11" 2 | -------------------------------------------------------------------------------- /test/unit/count1.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000 (00000012400034568000000000000001) (00000012400034568000000000000002) (00000012400034568000000000000003)) 2 | ok (("one") ("two") ("three")) 3 | -------------------------------------------------------------------------------- /test/unit/count2.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok (00000012400034568000000000000001) 3 | ok (00000012400034568000000000000002) 4 | ok id="()" () 5 | error EMPTY id="error EMPTY" "not found" 6 | error EMPTY id="error EMPTY" "not found" 7 | error EMPTY id="error EMPTY" "not found" 8 | -------------------------------------------------------------------------------- /test/unit/countabunch.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok (00000012400034568000000000000001) 3 | ok (00000012400034568000000000000002) 4 | ok (00000012400034568000000000000003) 5 | ok (00000012400034568000000000000004) 6 | ok (00000012400034568000000000000005) 7 | ok (00000012400034568000000000000006) 8 | ok (00000012400034568000000000000007) 9 | ok (00000012400034568000000000000008) 10 | ok (00000012400034568000000000000009) 11 | ok 10 12 | ok (10) 13 | error SYNTAX "'count', 'cursor', 'estimate', 'estimate-count', 'iterator', or 'timeout' can only appear inside at most one set of parentheses" 14 | -------------------------------------------------------------------------------- /test/unit/cursor2.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok (00000012400034568000000000000001) 3 | ok (00000012400034568000000000000002) 4 | error BADCURSOR "cannot parse old-style cursor \"START\"" 5 | error SYNTAX "on line 1, column 14: 'start': expected 'null' or a cursor value" 6 | ok ((00000012400034568000000000000000 null "a" string "1" null true true 1970-01-01T00:00:00.0000Z) (00000012400034568000000000000001 null "b" string "2" null true true 1970-01-01T00:00:00.0001Z) (00000012400034568000000000000002 null "c" string "3" null true true 1970-01-01T00:00:00.0002Z)) 7 | -------------------------------------------------------------------------------- /test/unit/cursor2.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bty <<-'EOF' 22 | write (name="a" value="1") 23 | write (name="b" value="2") 24 | write (name="c" value="3") 25 | read (cursor="START") 26 | read (cursor=start) 27 | read (cursor=null) 28 | EOF 29 | rm -rf $D 30 | -------------------------------------------------------------------------------- /test/unit/cursor4.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000 (00000012400034568000000000000004 (00000012400034568000000000000001 (00000012400034568000000000000003 (00000012400034568000000000000002)))) (00000012400034568000000000000008 (00000012400034568000000000000005 (00000012400034568000000000000007 (00000012400034568000000000000006)))) (0000001240003456800000000000000c (00000012400034568000000000000009 (0000001240003456800000000000000b (0000001240003456800000000000000a)))) (00000012400034568000000000000010 (0000001240003456800000000000000d (0000001240003456800000000000000f (0000001240003456800000000000000e)))) (00000012400034568000000000000014 (00000012400034568000000000000011 (00000012400034568000000000000013 (00000012400034568000000000000012))))) 2 | ok ("cursor:1c02:[o:3][n:21]fixed:5:2,6,10,14,18/3/" ("A") ("B") ("C")) 3 | ok ("null:" ("D") ("E")) 4 | error EMPTY "not found" 5 | -------------------------------------------------------------------------------- /test/unit/cvt.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000 (00000012400034568000000000000001) (00000012400034568000000000000002)) 2 | ok (00000012400034568000000000000003 (00000012400034568000000000000004) (00000012400034568000000000000005) (00000012400034568000000000000006) (00000012400034568000000000000007)) 3 | ok (00000012400034568000000000000008 (00000012400034568000000000000009) (0000001240003456800000000000000a) (0000001240003456800000000000000b)) 4 | error SYNTAX "variable $value is returned, but not set in the constraint or any subconstraint" 5 | ok ((3 "ann" (("green") ("blue") ("yellow"))) (2 "chris" (("green") ("blue"))) (2 "bob" (("green") ("blue")))) 6 | error SYNTAX "variable $foo is returned, but not set in the constraint or any subconstraint" 7 | -------------------------------------------------------------------------------- /test/unit/datatype.out.exp: -------------------------------------------------------------------------------- 1 | error SEMANTICS "on line 1, column 17: 'hippopotamus': invalid datatype" 2 | ok (00000012400034568000000000000000) 3 | ok (boolean "false") 4 | ok (00000012400034568000000000000001) 5 | ok (boolean "true") 6 | -------------------------------------------------------------------------------- /test/unit/dateline-2.out.exp: -------------------------------------------------------------------------------- 1 | removing 2 | running 3 | ok dateline="0000001240003456800000000000000a" (00000012400034568000000000000009) 4 | ok dateline="0000001240003456800000000000000d" (0000001240003456800000000000000c) 5 | ok dateline="00000012400034568000000000000010" (0000001240003456800000000000000f) 6 | ok dateline="00000012400034568000000000000013" (00000012400034568000000000000012) 7 | ok dateline="00000012400034568000000000000016" (00000012400034568000000000000015) 8 | ok dateline="00000012400034568000000000000019" (00000012400034568000000000000018) 9 | ok dateline="0000001240003456800000000000001a" (00000012400034568000000000000019) 10 | ok dateline="0000001240003456800000000000001a" ("null:") 11 | -------------------------------------------------------------------------------- /test/unit/dateline-3.out.exp: -------------------------------------------------------------------------------- 1 | ok dateline="0000001240003456800000000000000a" (00000012400034568000000000000009) 2 | ok dateline="0000001240003456800000000000000d" (0000001240003456800000000000000c) 3 | ok dateline="00000012400034568000000000000010" (0000001240003456800000000000000f) 4 | ok dateline="00000012400034568000000000000013" (00000012400034568000000000000012) 5 | ok dateline="00000012400034568000000000000016" (00000012400034568000000000000015) 6 | ok dateline="00000012400034568000000000000019" (00000012400034568000000000000018) 7 | ok dateline="0000001240003456800000000000001c" (0000001240003456800000000000001b) 8 | ok dateline="0000001240003456800000000000001d" (0000001240003456800000000000001c) 9 | ok dateline="0000001240003456800000000000001d" ("null:") 10 | -------------------------------------------------------------------------------- /test/unit/dateline-4.out.exp: -------------------------------------------------------------------------------- 1 | ok dateline="00000012400034568000000000000001" (00000012400034568000000000000000) 2 | ok dateline="00000012400034568000000000000002" (00000012400034568000000000000001) 3 | ok dateline="00000012400034568000000000000003" (00000012400034568000000000000002) 4 | ok dateline="00000012400034568000000000000004" (00000012400034568000000000000003) 5 | ok dateline="00000012400034568000000000000005" (00000012400034568000000000000004) 6 | ok ("sort:[o:2][n:5]s4:pearg00000012400034568000000000000000" ("onion") ("pear")) 7 | ok dateline="00000012400034568000000000000006" (00000012400034568000000000000005) 8 | ok dateline="00000012400034568000000000000007" (00000012400034568000000000000006) 9 | ok ("sort:[o:4][n:5]s6:potatog00000012400034568000000000000002" ("pepper") ("potato")) 10 | ok ("null:" ("tomato")) 11 | -------------------------------------------------------------------------------- /test/unit/dateline-5.out.exp: -------------------------------------------------------------------------------- 1 | starting write 1 2 | ok dateline="00000012400034568000000000000002" (00000012400034568000000000000001) 3 | write 1: Done. 4 | ok (00000012400034568000000000000000) 5 | write 2: Done. 6 | -------------------------------------------------------------------------------- /test/unit/david_1.conf: -------------------------------------------------------------------------------- 1 | 2 | shutdown-delay 0 3 | database { 4 | type addb 5 | path david_1 6 | gmap-split-thr 2 7 | sync false 8 | } 9 | core true 10 | -------------------------------------------------------------------------------- /test/unit/david_3.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | error EMPTY "not found" 3 | -------------------------------------------------------------------------------- /test/unit/david_3.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | # Reading from an empty gmap should do the right thing. 17 | B=`basename $0 .sh` 18 | cd `dirname $0` 19 | source ./rungraphd 20 | 21 | rm -rf $D 22 | 23 | 24 | rungraphd -d${D} -bty <<-EOF 25 | write () 26 | read (right=00000012400034568000000000000000) 27 | EOF 28 | 29 | 30 | rm -rf $D 31 | -------------------------------------------------------------------------------- /test/unit/david_4.conf: -------------------------------------------------------------------------------- 1 | 2 | shutdown-delay 0 3 | database { 4 | type addb 5 | path david_4 6 | gmap-split-thr 4 7 | sync false 8 | } 9 | core true 10 | -------------------------------------------------------------------------------- /test/unit/david_4.out.exp: -------------------------------------------------------------------------------- 1 | ok ((0000001240003456800000000000005d)) 2 | -------------------------------------------------------------------------------- /test/unit/david_7.out.exp: -------------------------------------------------------------------------------- 1 | ok id="1" (00000012400034568000000000000001 (00000012400034568000000000000000)) 2 | ok id="2" (00000012400034568000000000000003 (00000012400034568000000000000002)) 3 | ok id="3" (00000012400034568000000000000005 (00000012400034568000000000000004)) 4 | ok id="4" (00000012400034568000000000000007 (00000012400034568000000000000006)) 5 | ok id="5" (00000012400034568000000000000009 (00000012400034568000000000000008)) 6 | ok id="6" (("1" "AB") ("1" "Aa") ("02" "Ab") ("2" "aa") ("17" "ab")) 7 | ok id="7" (("1" "Aa") ("1" "AB") ("2" "aa") ("02" "Ab") ("17" "ab")) 8 | ok id="8" (("AB" "1") ("Aa" "1") ("Ab" "02") ("aa" "2") ("ab" "17")) 9 | ok id="9" (("1" "AB") ("1" "Aa") ("02" "Ab") ("2" "aa") ("17" "ab")) 10 | ok id="10" (("02") ("1") ("1") ("17") ("2") ("Aa") ("aa") ("ab") ("Ab") ("AB")) 11 | error SEMANTICS id="11" "more sort comparators than sorts" 12 | error SEMANTICS id="12" "only one sort-comparator clause per constraint" 13 | -------------------------------------------------------------------------------- /test/unit/david_8.out.exp: -------------------------------------------------------------------------------- 1 | ok id="1" (00000012400034568000000000000000) 2 | ok id="2" (00000012400034568000000000000001) 3 | error EMPTY id="r1" "not found" 4 | ok id="r2" ((00000012400034568000000000000001 null null string "10" null true true 1970-01-01T00:00:00.0001Z)) 5 | ok id="r3" (("2 a") ("10")) 6 | -------------------------------------------------------------------------------- /test/unit/dbname.broken.conf: -------------------------------------------------------------------------------- 1 | pid-file dbname.pid 2 | database { 3 | id "METAWEBBALICIOUS" 4 | path "dbname" 5 | } 6 | 7 | -------------------------------------------------------------------------------- /test/unit/dbname.conf: -------------------------------------------------------------------------------- 1 | pid-file dbname.pid 2 | database { 3 | id "METAWEB" 4 | path "dbname" 5 | } 6 | 7 | -------------------------------------------------------------------------------- /test/unit/dbname.err.exp: -------------------------------------------------------------------------------- 1 | ERROR: non-numerical database IDs are limited to 7 characters - can't use "METAWEBBALICIOUS" 2 | -------------------------------------------------------------------------------- /test/unit/dbname.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bty -f dbname.broken.conf 22 | rungraphd -d${D} -bty -f dbname.conf <<-'EOF' 23 | write (type="animal") 24 | write (type="vegetable") 25 | read (any) 26 | EOF 27 | rm -rf $D 28 | -------------------------------------------------------------------------------- /test/unit/default-results.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000 (00000012400034568000000000000001) (00000012400034568000000000000003 (00000012400034568000000000000002))) 2 | ok ((00000012400034568000000000000000 null "a" null null null true true 1970-01-01T00:00:00.0000Z) (-> 00000012400034568000000000000001 null "b" null null null true true 1970-01-01T00:00:00.0001Z null 00000012400034568000000000000000) (00000012400034568000000000000002 null "d" null null null true true 1970-01-01T00:00:00.0002Z) (-> 00000012400034568000000000000003 null "c" null null null true true 1970-01-01T00:00:00.0003Z 00000012400034568000000000000000 00000012400034568000000000000002)) 3 | error SEMANTICS "on line 1, column 15: ')': unknown subconstraint linkage" 4 | -------------------------------------------------------------------------------- /test/unit/default-results.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bty <<-'EOF' 22 | write (name="a" (-> name="b") (<- name="c" (name="d"))) 23 | read (any) 24 | read (any (any)) 25 | EOF 26 | rm -rf $D 27 | -------------------------------------------------------------------------------- /test/unit/doubletrouble.err.exp: -------------------------------------------------------------------------------- 1 | ERROR: graphd: another server is already accessing the database "doubletrouble". 2 | ERROR: graphd: shut down that process before starting a new one. 3 | 4 | -------------------------------------------------------------------------------- /test/unit/doubletrouble.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -itcp::54321 -d${D} -p${B}.pid -bt 22 | rungraphd -itcp::54321 -d${D} -bty 23 | rungraphd -itcp::54321 -d${D} -p${B}.pid -z 24 | rm -rf $D 25 | -------------------------------------------------------------------------------- /test/unit/duck.out.exp: -------------------------------------------------------------------------------- 1 | error SEMANTICS "on line 1, column 8: 'duck': invalid constraint" 2 | error SEMANTICS "on line 1, column 8: 'quack': invalid constraint" 3 | -------------------------------------------------------------------------------- /test/unit/duck.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bty <<-'EOF' 22 | write (duck) 23 | write (quack, dammit) 24 | EOF 25 | rm -rf $D 26 | -------------------------------------------------------------------------------- /test/unit/dump.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000009) 2 | error SEMANTICS "start 9 exceeds end 0" 3 | -------------------------------------------------------------------------------- /test/unit/dump.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bty <<-'EOF' 22 | write ("foo") 23 | dump (start=9 end=0) 24 | EOF 25 | rm -rf $D 26 | -------------------------------------------------------------------------------- /test/unit/dump2.out.exp: -------------------------------------------------------------------------------- 1 | error SYNTAX "on line 1, column 7: \"hello, world\": expected a dump constraint, or ')'" 2 | -------------------------------------------------------------------------------- /test/unit/dump2.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bty <<-'EOF' 22 | dump ("hello, world") 23 | EOF 24 | rm -rf $D 25 | -------------------------------------------------------------------------------- /test/unit/dumpnl.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok ("6" 0 1 (00000012400034568000000000000000 null null string "Here comes the newline: \n" 0 true true true 1970-01-01T00:00:00.0000Z 0 0 0)) 3 | -------------------------------------------------------------------------------- /test/unit/dumpnl.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | # if buggy, this goes into an endless loop... 21 | 22 | rm -rf $D 23 | rungraphd -d${D} -bty <<-'EOF' 24 | write (value="Here comes the newline: \n") 25 | dump () 26 | EOF 27 | rm -rf $D 28 | -------------------------------------------------------------------------------- /test/unit/empty-result.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000009) 2 | ok (0000001240003456800000000000000c) 3 | ok (0000001240003456800000000000000f) 4 | ok (00000012400034568000000000000012) 5 | ok (() () () () () () () () () () () () () () () () () () ()) 6 | ok () 7 | -------------------------------------------------------------------------------- /test/unit/empty-result.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bty <<-'EOF' 22 | write ("d" value="4") 23 | write ("b" value="2") 24 | write ("a" value="1") 25 | write ("c" value="3") 26 | read (any result=(())) 27 | read (any result=()) 28 | EOF 29 | rm -rf $D 30 | -------------------------------------------------------------------------------- /test/unit/empty.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000009) 2 | ok ((00000012400034568000000000000009 "" null null null null true true 1970-01-01T00:00:00.0009Z)) 3 | -------------------------------------------------------------------------------- /test/unit/empty.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bty <<-'EOF' 22 | write (type="") 23 | read ("") 24 | EOF 25 | rm -rf $D 26 | -------------------------------------------------------------------------------- /test/unit/empty2.out.exp: -------------------------------------------------------------------------------- 1 | error EMPTY "not found" 2 | ok () 3 | -------------------------------------------------------------------------------- /test/unit/empty2.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bty <<-'EOF' 22 | read () 23 | read (optional) 24 | EOF 25 | rm -rf $D 26 | -------------------------------------------------------------------------------- /test/unit/emptydump.out.exp: -------------------------------------------------------------------------------- 1 | ok ("6" 0 0) 2 | -------------------------------------------------------------------------------- /test/unit/emptydump.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bty <<-'EOF' 22 | dump () 23 | EOF 24 | rm -rf $D 25 | -------------------------------------------------------------------------------- /test/unit/emptylit.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000 (00000012400034568000000000000001) (00000012400034568000000000000002)) 2 | ok 3 | ok ("a" "a") 4 | ok ( "a") 5 | ok ("a") 6 | ok (("a" "a") ("a" "a")) 7 | ok (("a" (("a")))) 8 | ok 9 | ok ("a" "a") 10 | ok ( "a") 11 | ok ("a") 12 | ok (("a" "a") ("a" "a")) 13 | ok (("a" (("a")))) 14 | ok (("a" (("a")))) 15 | ok (("a")) 16 | -------------------------------------------------------------------------------- /test/unit/emptyrestore.out.exp: -------------------------------------------------------------------------------- 1 | ok 2 | -------------------------------------------------------------------------------- /test/unit/emptyrestore.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bty <<-'EOF' 22 | restore ("1" 0 0) 23 | EOF 24 | rm -rf $D 25 | -------------------------------------------------------------------------------- /test/unit/estimate-count.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok 1 3 | ok (00000012400034568000000000000001 (00000012400034568000000000000002) (00000012400034568000000000000003) (00000012400034568000000000000004)) 4 | ok 5 5 | ok 5 6 | -------------------------------------------------------------------------------- /test/unit/estimate-count.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bty <<-'EOF' 22 | write () 23 | read (result=estimate-count) 24 | write ((<-)(<-)(<-)) 25 | read (result=estimate-count) 26 | read (result=estimate-count pagesize=1) 27 | EOF 28 | rm -rf $D 29 | -------------------------------------------------------------------------------- /test/unit/false.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | error EMPTY "not found" 3 | error EMPTY "not found" 4 | error SEMANTICS "on line 1, column 8: 'false': constraint can only be used in read requests" 5 | ok ((00000012400034568000000000000000 null null string "a" null true true 1970-01-01T00:00:00.0000Z)) 6 | ok () 7 | ok () 8 | error SEMANTICS "on line 1, column 8: 'optional': constraint can only be used in read requests" 9 | -------------------------------------------------------------------------------- /test/unit/flags-1.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok (00000012400034568000000000000001) 3 | ok (00000012400034568000000000000002) 4 | ok (00000012400034568000000000000003) 5 | ok ((00000012400034568000000000000000 null "one" null null null true false 1970-01-01T00:00:00.0000Z) (00000012400034568000000000000001 null "two" null null null true true 1970-01-01T00:00:00.0001Z) (00000012400034568000000000000003 null "four" null null null true true 1970-01-01T00:00:00.0003Z)) 6 | -------------------------------------------------------------------------------- /test/unit/flags-1.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bty <<-'EOF' 22 | write (name="one" archival=false) 23 | write (name="two" archival=true) 24 | write (name="three" live=false) 25 | write (name="four" live=true) 26 | read () 27 | EOF 28 | rm -rf $D 29 | -------------------------------------------------------------------------------- /test/unit/gpush.out.exp: -------------------------------------------------------------------------------- 1 | gpush: ok 2 | -------------------------------------------------------------------------------- /test/unit/guid.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok (00000012400034568000000000000001) 3 | ok (00000012400034568000000000000002) 4 | ok (00000012400034568000000000000003) 5 | ok (00000012400034568000000000000004) 6 | ok (("wallaby") ("kangaroo")) 7 | ok ((00000012400034568000000000000000 null null string "wallaby" null true true 1970-01-01T00:00:00.0000Z) (00000012400034568000000000000004 null null string "pineapple" null true true 1970-01-01T00:00:00.0004Z)) 8 | -------------------------------------------------------------------------------- /test/unit/guidlist5.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok (00000012400034568000000000000001) 3 | ok (00000012400034568000000000000002) 4 | ok (00000012400034568000000000000003) 5 | ok id="b" (("b")) 6 | ok id="b" (("b")) 7 | ok id="b" (("b")) 8 | ok id="abc" (("a") ("b") ("c")) 9 | -------------------------------------------------------------------------------- /test/unit/id.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok id="bloop" (00000012400034568000000000000001) 3 | ok id="fleep" ((00000012400034568000000000000000 null "vegetable" null null null true true 1970-01-01T00:00:00.0000Z) (00000012400034568000000000000001 null "random" null null null true true 1970-01-01T00:00:00.0001Z)) 4 | -------------------------------------------------------------------------------- /test/unit/id.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bty <<-'EOF' 22 | write (name="vegetable") 23 | write id="bloop" (name="random") 24 | read id="fleep" () 25 | EOF 26 | rm -rf $D 27 | -------------------------------------------------------------------------------- /test/unit/infcur.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok (00000012400034568000000000000001) 3 | ok (00000012400034568000000000000002) 4 | ok ("cursor:f655:[o:1][n:3]all:0-3/1/" ("1")) 5 | ok ("cursor:f659:[o:1][n:3]all:0-3/2/" ("2")) 6 | error EMPTY "not found" 7 | -------------------------------------------------------------------------------- /test/unit/instance-id.conf: -------------------------------------------------------------------------------- 1 | database 2 | { 3 | path sync.db 4 | } 5 | 6 | instance-id zork2 7 | 8 | -------------------------------------------------------------------------------- /test/unit/instance-id.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok (00000012400034568000000000000001) 3 | error DATELINE dateline="zork,00000012400034568000000000000002" "your dateline is not valid on this server" 4 | ok dateline="zork,00000012400034568000000000000002" ((00000012400034568000000000000000) (00000012400034568000000000000001)) 5 | ok ("zork") 6 | ok 7 | error DATELINE dateline="palm,00000012400034568000000000000002" "your dateline is not valid on this server" 8 | error DATELINE dateline="palm,00000012400034568000000000000002" "your dateline is not valid on this server" 9 | ok ("zork") 10 | ok ("zork2") 11 | ok 12 | ok ("") 13 | ok dateline="00000012400034568000000000000002" ((00000012400034568000000000000000) (00000012400034568000000000000001)) 14 | -------------------------------------------------------------------------------- /test/unit/intrange.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok (00000012400034568000000000000001) 3 | ok (00000012400034568000000000000002) 4 | ok (00000012400034568000000000000003) 5 | ok (00000012400034568000000000000004) 6 | ok (00000012400034568000000000000005) 7 | ok (00000012400034568000000000000006) 8 | ok (("100") ("99")) 9 | ok (("1") ("100") ("2") ("88") ("95") ("99")) 10 | ok (("100") ("101") ("99")) 11 | -------------------------------------------------------------------------------- /test/unit/iterator1.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok (("all" 0 0) (("n" 1) ("check-cost" 1) ("next-cost" 1) ("find-cost" 0) ("low" 0) ("high" 1) "forward")) 3 | ok ((("all" 0 0) (("n" 1) ("check-cost" 1) ("next-cost" 1) ("find-cost" 0) ("low" 0) ("high" 1) "forward"))) 4 | error SYNTAX "'count', 'cursor', 'estimate', 'estimate-count', 'iterator', or 'timeout' can only appear inside at most one set of parentheses" 5 | ok ("all[0...1: 1]" true 1 1 1) 6 | ok (("all[0...1: 1]" true 1 1 1)) 7 | error SYNTAX "'count', 'cursor', 'estimate', 'estimate-count', 'iterator', or 'timeout' can only appear inside at most one set of parentheses" 8 | -------------------------------------------------------------------------------- /test/unit/iterator1.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bty <<-'EOF' 22 | write() 23 | read (result=iterator) 24 | read (result=(iterator)) 25 | read (result=((iterator))) 26 | read (result=estimate) 27 | read (result=(estimate)) 28 | read (result=((estimate))) 29 | EOF 30 | rm -rf $D 31 | -------------------------------------------------------------------------------- /test/unit/joburg.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | # Ben's first test data 21 | 22 | rm -rf ${D} 23 | rungraphd -d${D} -bty < joburg.in 24 | rm -rf ${D} ./${B}.pid 25 | -------------------------------------------------------------------------------- /test/unit/keyburn.out.exp: -------------------------------------------------------------------------------- 1 | ok 2 | ok (0100007f4000723a8000000000000048 (0100007f4000723a8000000000000049)) 3 | -------------------------------------------------------------------------------- /test/unit/keyburn3.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000 (00000012400034568000000000000002 (00000012400034568000000000000001))) 2 | ok (00000012400034568000000000000001 (00000012400034568000000000000002)) 3 | -------------------------------------------------------------------------------- /test/unit/keyburn4.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000001 (00000012400034568000000000000000)) 2 | ok (00000012400034568000000000000000 (00000012400034568000000000000001)) 3 | -------------------------------------------------------------------------------- /test/unit/keyburn5.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok (00000012400034568000000000000001) 3 | ok (00000012400034568000000000000001) 4 | error SYNTAX "cannot mix \"key=\" and \"guid~=\" constraints - did you mean \"unique\"?" 5 | -------------------------------------------------------------------------------- /test/unit/kurt1.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000009 (00000012400034568000000000000011 (0000001240003456800000000000000c (00000012400034568000000000000010 (0000001240003456800000000000000d (0000001240003456800000000000000f (0000001240003456800000000000000e))))))) 2 | ok (("a2" (("a3" (("a4")))))) 3 | -------------------------------------------------------------------------------- /test/unit/kurt2.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000009 (0000001240003456800000000000000f (0000001240003456800000000000000e)) (00000012400034568000000000000011 (00000012400034568000000000000010)) (00000012400034568000000000000013 (00000012400034568000000000000012))) 2 | ok (("t1") ("t2") ("t3")) 3 | -------------------------------------------------------------------------------- /test/unit/kurt3.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000009 (0000001240003456800000000000000c) (0000001240003456800000000000000d) (0000001240003456800000000000000e) (00000012400034568000000000000012 (00000012400034568000000000000011)) (00000012400034568000000000000014 (00000012400034568000000000000013)) (00000012400034568000000000000016 (00000012400034568000000000000015))) 2 | ok (("name1" "value1") ("name2" "value2") ("name3" "value3")) ((("name4" "value4")) (("name5" "value5")) (("name6" "value6"))) 3 | -------------------------------------------------------------------------------- /test/unit/kurt4.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000009 (00000012400034568000000000000018 (0000001240003456800000000000000e (00000012400034568000000000000017 (00000012400034568000000000000013 (00000012400034568000000000000016))))) (0000001240003456800000000000001d (00000012400034568000000000000019 (0000001240003456800000000000001c (0000001240003456800000000000001a (0000001240003456800000000000001b))))) (00000012400034568000000000000022 (0000001240003456800000000000001e (00000012400034568000000000000021 (0000001240003456800000000000001f (00000012400034568000000000000020)))))) 2 | ok ((("A" "Afirst Alast")) (("B" "Bfirst Blast")) (("C" "Cfirst Clast"))) 3 | -------------------------------------------------------------------------------- /test/unit/kurt5.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000009 (00000012400034568000000000000018 (0000001240003456800000000000000e (00000012400034568000000000000017 (00000012400034568000000000000013 (00000012400034568000000000000016))))) (0000001240003456800000000000001d (00000012400034568000000000000019 (0000001240003456800000000000001c (0000001240003456800000000000001a (0000001240003456800000000000001b))))) (00000012400034568000000000000022 (0000001240003456800000000000001e (00000012400034568000000000000021 (0000001240003456800000000000001f (00000012400034568000000000000020)))))) 2 | ok ((("A" "Afirst Alast")) (("B" "Bfirst Blast")) (("C" "Cfirst Clast"))) 3 | -------------------------------------------------------------------------------- /test/unit/kurt6.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000009 (00000012400034568000000000000015 (0000001240003456800000000000000e (00000012400034568000000000000014 (00000012400034568000000000000013)))) (00000012400034568000000000000017 (00000012400034568000000000000016)) (0000001240003456800000000000002f (0000001240003456800000000000001a (00000012400034568000000000000020 (0000001240003456800000000000001f)) (00000012400034568000000000000022 (00000012400034568000000000000021)) (00000012400034568000000000000024 (00000012400034568000000000000023)) (00000012400034568000000000000026 (00000012400034568000000000000025)) (00000012400034568000000000000028 (00000012400034568000000000000027)) (0000001240003456800000000000002a (00000012400034568000000000000029)) (0000001240003456800000000000002c (0000001240003456800000000000002b)) (0000001240003456800000000000002e (0000001240003456800000000000002d)))) (00000012400034568000000000000031 (00000012400034568000000000000030))) 2 | -------------------------------------------------------------------------------- /test/unit/link1.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok (0000001240003456800000000000000a) 3 | ok (0000001240003456800000000000000b) 4 | error SEMANTICS "on line 1, column 53: ')': unknown subconstraint linkage" 5 | error SEMANTICS "cannot mix <-right and right=..." 6 | error SEMANTICS "on line 1, column 58: ')': unknown subconstraint linkage" 7 | error SEMANTICS "cannot mix <-left and left=..." 8 | error SEMANTICS "on line 1, column 21: ')': unknown subconstraint linkage" 9 | ok (0000001240003456800000000000000d (0000001240003456800000000000000c)) 10 | error SEMANTICS "on line 1, column 26: ')': unknown subconstraint linkage" 11 | error LEXICAL "on line 1, column 8: '~': invalid token" 12 | -------------------------------------------------------------------------------- /test/unit/link2.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000009) 2 | error SEMANTICS "left=00000012400034568000000000000014: not found" 3 | ok (0000001240003456800000000000000c) 4 | error SEMANTICS "left=8d159e244000048d8000000056789012: not found" 5 | ok (0000001240003456800000000000000f) 6 | -------------------------------------------------------------------------------- /test/unit/linklink1.out.exp: -------------------------------------------------------------------------------- 1 | error SEMANTICS "on line 1, column 31: ')': unknown subconstraint linkage" 2 | ok (00000012400034568000000000000000 (00000012400034568000000000000002 (00000012400034568000000000000003) (00000012400034568000000000000001))) 3 | ok (("baz")) 4 | ok (("quut")) 5 | ok (("quut")) 6 | -------------------------------------------------------------------------------- /test/unit/linklink2.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000 (00000012400034568000000000000001 (00000012400034568000000000000002) (00000012400034568000000000000004 (00000012400034568000000000000003)))) 2 | ok (("d")) (("c")) 3 | ok (00000012400034568000000000000005 (00000012400034568000000000000006)) 4 | ok (("b")) 5 | -------------------------------------------------------------------------------- /test/unit/linklink4.out.exp: -------------------------------------------------------------------------------- 1 | error SEMANTICS "can't use (<-left ..) on the outermost constraint - do you mean left=GUID?" 2 | -------------------------------------------------------------------------------- /test/unit/linklink4.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | # write (-> name="a" (name="b")) 21 | rm -rf $D 22 | rungraphd -d${D} -bty <<-'EOF' 23 | write (<-left name="a" right->(name="b")) 24 | EOF 25 | rm -rf $D 26 | -------------------------------------------------------------------------------- /test/unit/literal1.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok (00000012400034568000000000000001) 3 | error SYNTAX "on line 1, column 21: ')': missing '=' after 'literal'" 4 | ok blue 5 | ok (blue) 6 | ok ((blue) (blue)) 7 | -------------------------------------------------------------------------------- /test/unit/literal1.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bty <<-'EOF' 22 | write (name="zippedidoodah") 23 | write (name="eep") 24 | read (result=literal) 25 | read (result=literal=blue) 26 | read (result=(literal=blue)) 27 | read (result=((literal="blue"))) 28 | EOF 29 | rm -rf $D 30 | -------------------------------------------------------------------------------- /test/unit/localtype.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000009) 2 | ok (0000001240003456800000000000000a (0000001240003456800000000000000d (0000001240003456800000000000000b (0000001240003456800000000000000c)))) 3 | ok ((0000001240003456800000000000000c "vegetable" null string "carrot" null true true 1970-01-01T00:00:00.0012Z)) 4 | -------------------------------------------------------------------------------- /test/unit/loglevel.out.exp: -------------------------------------------------------------------------------- 1 | ok ((operator-error) (operator-error) (operator-error)) 2 | -------------------------------------------------------------------------------- /test/unit/loglevel.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bty <<-'EOF' 22 | status (loglevel loglevel loglevel) 23 | EOF 24 | rm -rf $D 25 | -------------------------------------------------------------------------------- /test/unit/logrotate.conf: -------------------------------------------------------------------------------- 1 | listen tcp { 2 | port 12345 3 | } 4 | 5 | pid-file logrotate.pid 6 | 7 | log-file graphd.log.%M 8 | log-level info 9 | log-flush true 10 | 11 | netlog-file graphd.netlog.%M 12 | netlog-level info 13 | netlog-flush true 14 | -------------------------------------------------------------------------------- /test/unit/logrotate.out.exp: -------------------------------------------------------------------------------- 1 | 4 2 | -------------------------------------------------------------------------------- /test/unit/multirestore.out.exp: -------------------------------------------------------------------------------- 1 | ok 2 | ok 3 | ok 4 | ok 5 | ok 6 | ok 7 | ok 8 | ok 9 | ok 10 | ok 11 | ok 12 | ok 13 | ok 14 | ok 15 | ok 16 | ok 17 | ok 18 | ok 19 | ok 20 | ok 21 | ok 22 | -------------------------------------------------------------------------------- /test/unit/ne.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok (00000012400034568000000000000001) 3 | ok (00000012400034568000000000000002) 4 | error SEMANTICS "on line 1, column 12: '!=': operator cannot be used in write requests" 5 | ok (("a") ("b")) 6 | ok (("a") ("b")) 7 | ok (("a") ("b")) 8 | ok (("a") ("b")) 9 | ok ((null) ("b")) 10 | ok ((null) ("b")) 11 | ok ((null)) 12 | ok ((null)) 13 | ok (("b")) 14 | ok (("b")) 15 | error EMPTY "not found" 16 | ok ((null)) 17 | ok (("b")) 18 | ok (("b")) 19 | -------------------------------------------------------------------------------- /test/unit/nick1.out.exp: -------------------------------------------------------------------------------- 1 | error SEMANTICS "can't use \"contents\" return instruction in template without contained templates" 2 | -------------------------------------------------------------------------------- /test/unit/nick1.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bty <<-'EOF' 22 | read (any 23 | (<-right left->(result=((contents)))) 24 | (<-right result=(guid)) 25 | ) 26 | EOF 27 | rm -rf $D 28 | -------------------------------------------------------------------------------- /test/unit/nick6.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok (00000012400034568000000000000001) 3 | ok (00000012400034568000000000000002) 4 | ok (00000012400034568000000000000003) 5 | ok (00000012400034568000000000000004) 6 | ok (00000012400034568000000000000005) 7 | ok (00000012400034568000000000000006) 8 | ok (00000012400034568000000000000007) 9 | ok (00000012400034568000000000000008) 10 | ok ("cursor:2757:[o:2][n:9]fixed:6:0,1,2,3,4,8/2/" (00000012400034568000000000000000 "avalanche") (00000012400034568000000000000001 "aardvark")) 11 | ok ("cursor:274f:[o:2][n:9]fixed:6:0,1,2,3,4,8/4/" (00000012400034568000000000000002 "a3") (00000012400034568000000000000003 "a4")) 12 | ok ("null:" (00000012400034568000000000000004 "a5") (00000012400034568000000000000008 "asterisk")) 13 | error EMPTY "not found" 14 | -------------------------------------------------------------------------------- /test/unit/nodenode.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000009 (00000012400034568000000000000011 (0000001240003456800000000000000c (00000012400034568000000000000010 (0000001240003456800000000000000d (0000001240003456800000000000000f (0000001240003456800000000000000e))))))) 2 | error SEMANTICS "on line 1, column 17: ')': unknown subconstraint linkage" 3 | -------------------------------------------------------------------------------- /test/unit/nodenode.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bty <<-'EOF' 22 | write ("article" value="a1" (<-"is-reply-to" ("article" value="a2" (<- "is-reply-to" ("article" value="a3" (<- "is-reply-to" ("article" value="a4"))))))) 23 | read (node (node)) 24 | EOF 25 | rm -rf $D 26 | -------------------------------------------------------------------------------- /test/unit/nonsense.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf ${D} 21 | rungraphd -d${D} -bty < nonsense.in 22 | rm -rf ${B} 23 | -------------------------------------------------------------------------------- /test/unit/now.out.exp: -------------------------------------------------------------------------------- 1 | ok dateline="00000012400034568000000000000001" (00000012400034568000000000000000) 2 | error SYNTAX dateline="00000012400034568000000000000000" "on line 1, column 15: \"now\": invalid dateline value" 3 | -------------------------------------------------------------------------------- /test/unit/now.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bty <<-'EOF' 22 | write dateline="" (name="vegetable") 23 | read dateline="now" () 24 | EOF 25 | rm -rf $D 26 | -------------------------------------------------------------------------------- /test/unit/nullcontent.out.exp: -------------------------------------------------------------------------------- 1 | ok null 2 | ok null 3 | ok (00000012400034568000000000000000) 4 | ok () 5 | ok (()) 6 | ok ((())) 7 | ok () 8 | ok (()) 9 | ok ((())) 10 | ok (00000012400034568000000000000001) 11 | ok ((<- 00000012400034568000000000000001 null null string "Hello, World!" null true true 1970-01-01T00:00:00.0001Z 00000012400034568000000000000000 null)) 12 | ok (((<- 00000012400034568000000000000001 null null string "Hello, World!" null true true 1970-01-01T00:00:00.0001Z 00000012400034568000000000000000 null))) 13 | ok ((((<- 00000012400034568000000000000001 null null string "Hello, World!" null true true 1970-01-01T00:00:00.0001Z 00000012400034568000000000000000 null))) (())) 14 | ok ((00000012400034568000000000000001 "Hello, World!")) 15 | ok (((00000012400034568000000000000001 "Hello, World!"))) 16 | ok ((((00000012400034568000000000000001 "Hello, World!"))) (())) 17 | -------------------------------------------------------------------------------- /test/unit/nullguid.out.exp: -------------------------------------------------------------------------------- 1 | error EMPTY "not found" 2 | error EMPTY "not found" 3 | error EMPTY "not found" 4 | error SEMANTICS "on line 1, column 12: 'null': null GUIDs cannot be used in this context" 5 | error EMPTY "not found" 6 | error EMPTY "not found" 7 | error EMPTY "not found" 8 | error EMPTY "not found" 9 | error EMPTY "not found" 10 | error EMPTY "not found" 11 | error EMPTY "not found" 12 | error EMPTY "not found" 13 | error EMPTY "not found" 14 | -------------------------------------------------------------------------------- /test/unit/nullguid2.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000 (00000012400034568000000000000001) (00000012400034568000000000000002)) 2 | ok (("topnode") ("lefty")) 3 | ok (("topnode") ("lefty")) 4 | ok (("topnode") ("righty")) 5 | -------------------------------------------------------------------------------- /test/unit/nullvalue.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok (00000012400034568000000000000001) 3 | ok ((00000012400034568000000000000000 null null string null null true true 1970-01-01T00:00:00.0000Z)) 4 | ok ((null null) (null "schornsteinfeger")) 5 | error EMPTY "not found" 6 | ok ((00000012400034568000000000000000 null null string null null true true 1970-01-01T00:00:00.0000Z)) 7 | -------------------------------------------------------------------------------- /test/unit/numberequal2.out.exp: -------------------------------------------------------------------------------- 1 | ok id="1" (00000012400034568000000000000000) 2 | ok id="2" (00000012400034568000000000000001) 3 | ok id="3" (00000012400034568000000000000002) 4 | ok id="r1" ((00000012400034568000000000000000 null null string "1E2" null true true 1970-01-01T00:00:00.0000Z) (00000012400034568000000000000002 null null string "100" null true true 1970-01-01T00:00:00.0002Z)) 5 | ok id="r2" ((00000012400034568000000000000000 null null string "1E2" null true true 1970-01-01T00:00:00.0000Z) (00000012400034568000000000000002 null null string "100" null true true 1970-01-01T00:00:00.0002Z)) 6 | ok id="r3" ((00000012400034568000000000000000 null null string "1E2" null true true 1970-01-01T00:00:00.0000Z) (00000012400034568000000000000002 null null string "100" null true true 1970-01-01T00:00:00.0002Z)) 7 | -------------------------------------------------------------------------------- /test/unit/numbermatch.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok (00000012400034568000000000000001) 3 | ok (("1 2 3")) 4 | ok (("1 2 3")) 5 | ok (("1 2 3")) 6 | ok (("04 005 0006")) 7 | ok (("04 005 0006")) 8 | ok (("04 005 0006")) 9 | -------------------------------------------------------------------------------- /test/unit/octet.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok (00000012400034568000000000000001) 3 | ok (("foo" "1") ("FOO" "2")) 4 | ok (("foo" "1")) 5 | error EMPTY "not found" 6 | ok (("FOO" "2")) 7 | ok (("foo" "1")) 8 | ok (("foo" "1") ("FOO" "2")) 9 | error EXISTS "primitive tagged as unique already exist" 10 | error EXISTS "primitive tagged as unique already exist" 11 | ok (00000012400034568000000000000002) 12 | ok (00000012400034568000000000000000) 13 | ok (00000012400034568000000000000001) 14 | ok (00000012400034568000000000000003) 15 | -------------------------------------------------------------------------------- /test/unit/ok.out.exp: -------------------------------------------------------------------------------- 1 | error SYNTAX "on line 1, column 1: 'ok': no such request" 2 | -------------------------------------------------------------------------------- /test/unit/onedump.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok ("6" 0 1 (00000012400034568000000000000000 null "vanilla" string "yum" 0 true true true 1970-01-01T00:00:00.0000Z 0 0 0)) 3 | -------------------------------------------------------------------------------- /test/unit/onedump.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bty <<-'EOF' 22 | write (name="vanilla" datatype=string value="yum") 23 | dump () 24 | EOF 25 | rm -rf $D 26 | -------------------------------------------------------------------------------- /test/unit/onerestore.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bty <<-'EOF' 22 | restore ("1" 0 1 (00000000000000000048d15800000000 "flower" "vanilla" string "yum" 0 true true 1970-01-01T00:00:00.0000 0 0 0)) 23 | read (any) 24 | EOF 25 | rm -rf $D 26 | -------------------------------------------------------------------------------- /test/unit/optional.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000009 (0000001240003456800000000000000d (0000001240003456800000000000000c)) (00000012400034568000000000000011 (00000012400034568000000000000010))) 2 | ok (00000012400034568000000000000012 (00000012400034568000000000000014 (00000012400034568000000000000013))) 3 | ok (00000012400034568000000000000015 (00000012400034568000000000000017 (00000012400034568000000000000016))) 4 | ok (00000012400034568000000000000018) 5 | ok (("B C" "b1") ("B" "b2")) 6 | ok (("B C" "b1" "c1") ("B" "b2" null)) 7 | ok (("B C" "c1") ("C" "c3")) 8 | ok (("B C" "b1" "c1") ("C" null "c3")) 9 | ok (("B C") ("B") ("C") ("nil")) 10 | ok (("B C" "c1" "b1") ("B" null "b2") ("C" "c3" null) ("nil" null null)) 11 | -------------------------------------------------------------------------------- /test/unit/or.out.exp: -------------------------------------------------------------------------------- 1 | error EMPTY "not found" 2 | error EMPTY "not found" 3 | ok (00000012400034568000000000000009) 4 | ok (0000001240003456800000000000000c) 5 | ok (("foo") ("bar")) 6 | ok (("foo") ("bar")) 7 | -------------------------------------------------------------------------------- /test/unit/or.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bty <<-'EOF' 22 | read (value=("foo" "bar")) 23 | read (value="foo"|value="bar") 24 | write ("foo") 25 | write ("bar") 26 | read (value=("foo" "bar") result=((value))) 27 | read (value="foo"|value="bar" result=((value))) 28 | EOF 29 | rm -rf $D 30 | -------------------------------------------------------------------------------- /test/unit/or4.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000 (00000012400034568000000000000001) (00000012400034568000000000000002)) 2 | ok ((("orange")) (null) (null)) 3 | ok ((null) (null) (null)) 4 | -------------------------------------------------------------------------------- /test/unit/override-dir-1.conf: -------------------------------------------------------------------------------- 1 | database { 2 | sync false 3 | } 4 | -------------------------------------------------------------------------------- /test/unit/override-dir-2.conf: -------------------------------------------------------------------------------- 1 | database 2 | { 3 | path "this path doesn't get created" 4 | sync false 5 | } 6 | -------------------------------------------------------------------------------- /test/unit/override-dir.err.exp: -------------------------------------------------------------------------------- 1 | ERROR: graphd: no database path in configuration file "override-dir-1.conf" or command line 2 | ERROR: graphd: failed to open "hey-this-file-doesnt-exist.conf" as a configuration file: No such file or directory 3 | -------------------------------------------------------------------------------- /test/unit/pagesize.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok (00000012400034568000000000000001) 3 | ok ((00000012400034568000000000000000 null "animal" null null null true true 1970-01-01T00:00:00.0000Z)) 4 | ok () 5 | error EMPTY "not found" 6 | -------------------------------------------------------------------------------- /test/unit/pagesize.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bty <<-'EOF' 22 | write (name="animal") 23 | write (name="vegetable") 24 | read (pagesize=1) 25 | read (name="vegetable" pagesize=0) 26 | read (name="fruit salad" pagesize=0) 27 | EOF 28 | rm -rf $D 29 | -------------------------------------------------------------------------------- /test/unit/param-order.out.exp: -------------------------------------------------------------------------------- 1 | ok () 2 | ok cost="omitted" () 3 | ok cost="omitted" cost="omitted" () 4 | ok cost="omitted" id="flipper" dateline="00000012400034568000000000000000" () 5 | ok cost="omitted" id="flipper" () 6 | ok dateline="00000012400034568000000000000000" () 7 | ok dateline="00000012400034568000000000000000" dateline="00000012400034568000000000000000" id="flipper" cost="omitted" () 8 | ok id="foo" () 9 | ok id="foo" cost="omitted" id="bar" () 10 | error SYNTAX id="foo" cost="omitted" "error parsing cost element at \"This is not a syntactically correct cost.\" -- expected '=', got 'i'" 11 | -------------------------------------------------------------------------------- /test/unit/pol.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000009 (0000001240003456800000000000000c) (0000001240003456800000000000000d) (0000001240003456800000000000000e)) 2 | ok (0000001240003456800000000000000f (00000012400034568000000000000010) (00000012400034568000000000000011) (00000012400034568000000000000012)) 3 | ok ("Republicans" "Cheney") 4 | ok ("Republicans" (("Cheney") ("Bush") ("McCain"))) 5 | ok (("Cheney") ("Bush") ("McCain")) 6 | ok (("Republicans" (("Cheney") ("Bush") ("McCain"))) ("Democrats" (("Lieberman") ("Kerry") ("Obama")))) 7 | -------------------------------------------------------------------------------- /test/unit/previous.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok null 3 | ok (00000012400034568000000000000001) 4 | ok 00000012400034568000000000000000 5 | ok (00000012400034568000000000000002) 6 | ok 00000012400034568000000000000001 7 | ok (00000012400034568000000000000003) 8 | ok 00000012400034568000000000000002 9 | ok (null) 10 | ok (00000012400034568000000000000000) 11 | ok (00000012400034568000000000000001) 12 | ok (00000012400034568000000000000002) 13 | ok ("Hello, Mars!" 00000012400034568000000000000002) 14 | -------------------------------------------------------------------------------- /test/unit/ques.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok (00000012400034568000000000000001) 3 | ok (00000012400034568000000000000002) 4 | ok (00000012400034568000000000000003) 5 | ok (00000012400034568000000000000004) 6 | ok (00000012400034568000000000000005) 7 | ok (00000012400034568000000000000006) 8 | ok (00000012400034568000000000000007) 9 | ok (00000012400034568000000000000008) 10 | ok (00000012400034568000000000000009) 11 | ok (0000001240003456800000000000000a) 12 | ok (0000001240003456800000000000000b) 13 | ok (("?") ("foo ?!bar") ("?!") ("foo!? bar") ("!?")) 14 | ok (("foo?bar") ("foo? bar") ("foo ?bar") ("?") ("foo?!bar") ("foo?! bar") ("foo ?!bar") ("?!") ("foo!?bar") ("foo!? bar") ("foo !?bar") ("!?")) 15 | ok (("foo? bar") ("foo?!bar") ("foo?! bar")) 16 | ok (("foo ?bar") ("foo!?bar") ("foo !?bar")) 17 | -------------------------------------------------------------------------------- /test/unit/random1.out.exp: -------------------------------------------------------------------------------- 1 | error EMPTY "not found" 2 | -------------------------------------------------------------------------------- /test/unit/random2.out.exp: -------------------------------------------------------------------------------- 1 | error SEMANTICS dateline="00000012400034568000000000000000" "on line 1, column 29: '42705294': too many records" 2 | -------------------------------------------------------------------------------- /test/unit/random2.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bty <<-'EOF' 22 | rEsTORe dateliNe="" ("2" 21 42705294 ) 23 | EOF 24 | rm -rf $D 25 | -------------------------------------------------------------------------------- /test/unit/random3.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok (00000012400034568000000000000001 (00000012400034568000000000000002)) 3 | -------------------------------------------------------------------------------- /test/unit/random3.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bty <<-'EOF' 22 | write () 23 | write (( <-right unique=right )) 24 | EOF 25 | rm -rf $D 26 | -------------------------------------------------------------------------------- /test/unit/random4.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000009) 2 | error SEMANTICS "on line 1, column 17: 'right': duplicate linkage declaration" 3 | error SEMANTICS "on line 1, column 16: 'left': duplicate linkage declaration" 4 | error SEMANTICS "on line 1, column 20: 'typeguid': duplicate linkage declaration" 5 | error SEMANTICS "on line 1, column 17: 'scope': duplicate linkage declaration" 6 | error SEMANTICS "on line 1, column 18: 'right': duplicate linkage declaration" 7 | error SEMANTICS "on line 1, column 17: 'left': duplicate linkage declaration" 8 | error SEMANTICS "on line 1, column 21: 'typeguid': duplicate linkage declaration" 9 | error SEMANTICS "on line 1, column 18: 'scope': duplicate linkage declaration" 10 | -------------------------------------------------------------------------------- /test/unit/random5.out.exp: -------------------------------------------------------------------------------- 1 | error EMPTY "not found" 2 | error EMPTY "not found" 3 | error EMPTY "not found" 4 | error EMPTY "not found" 5 | error EMPTY "not found" 6 | ok () 7 | ok () 8 | ok () 9 | ok () 10 | ok () 11 | -------------------------------------------------------------------------------- /test/unit/random6.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok (00000012400034568000000000000001) 3 | ok (00000012400034568000000000000002) 4 | error SEMANTICS "duplicate assignment to \"live\" flag" 5 | -------------------------------------------------------------------------------- /test/unit/random6.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | source `dirname $0`/rungraphd 18 | cd `dirname $0` 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bty <<-'EOF' 22 | write () 23 | write () 24 | write () 25 | read (( <-right scope->( typeguid->( live=false live=true )))) 26 | EOF 27 | rm -rf $D 28 | exit 29 | 30 | -------------------------------------------------------------------------------- /test/unit/rep1.err.exp: -------------------------------------------------------------------------------- 1 | ERROR: configuration file "rep1.cfg", line 2: expected "host" or "port" in replica statement, got "part" 2 | ERROR: configuration file "rep1.cfg", line 3: expected "host" or "port" in replica statement, got "hyst" 3 | ERROR: configuration file "rep1.cfg", line 4: expected "host" or "port" in replica statement, got "schnozzledeboop" 4 | -------------------------------------------------------------------------------- /test/unit/rerestore.out.exp: -------------------------------------------------------------------------------- 1 | ok 2 | ok 3 | ok ((0701a8c04000757a800000000000138c "#0701a8c04000757a8000000000000008" null string "Monopoly" null true true 2006-04-25T22:45:54.1261Z)) 4 | -------------------------------------------------------------------------------- /test/unit/rerestore2.out.exp: -------------------------------------------------------------------------------- 1 | error SEMANTICS "restored records must be contiguous - cannot restore records above 0 (attempted: 6021)" 2 | -------------------------------------------------------------------------------- /test/unit/rerestore2.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bty <<-'EOF' 22 | restore ("2" 6021 6022 (113a9a8400001c06a301d5e800000000 null null null null 0 true true 2006-04-25T22:45:53.0000 0 0 0)) 23 | EOF 24 | rm -rf $D 25 | -------------------------------------------------------------------------------- /test/unit/rest-over1.in: -------------------------------------------------------------------------------- 1 | write (value="foo") 2 | write (value="bar" (<-right value="foobar" left->(value="foo" key=value)) (<-left value="barfoo" right->(value="foo" key=value))) 3 | write (value="baz" typeguid->(value="foo" key=value)) 4 | write (name="bazooka" scope->(value="foo" key=value)) 5 | -------------------------------------------------------------------------------- /test/unit/rest-over1.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok (00000012400034568000000000000001 (00000012400034568000000000000002 (00000012400034568000000000000000)) (00000012400034568000000000000003 (00000012400034568000000000000000))) 3 | ok (00000012400034568000000000000004 (00000012400034568000000000000000)) 4 | ok (00000012400034568000000000000005 (00000012400034568000000000000000)) 5 | ok 6 | -------------------------------------------------------------------------------- /test/unit/rest-over2.out.exp: -------------------------------------------------------------------------------- 1 | ok 2 | ok 3 | -------------------------------------------------------------------------------- /test/unit/results.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | error SEMANTICS "more than one value for result" 3 | error SEMANTICS "more than one value for result" 4 | error SEMANTICS "more than one value for result" 5 | -------------------------------------------------------------------------------- /test/unit/results.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bty <<-'EOF' 22 | write (value="foo") 23 | read (any result=(value) result=(name)) 24 | read (any result=() result=(())) 25 | read (any result=() result=() result=() result=()) 26 | EOF 27 | rm -rf $D 28 | -------------------------------------------------------------------------------- /test/unit/rollback.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | error EXISTS "primitive tagged as unique already exist" 3 | -------------------------------------------------------------------------------- /test/unit/rollback.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bty <<-'EOF' 22 | write (name="bob") 23 | write (name="animal" 24 | (-> name="flora") 25 | (-> (name="bob" unique=name))) 26 | EOF 27 | rm -rf $D 28 | -------------------------------------------------------------------------------- /test/unit/search.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000009) 2 | ok (0000001240003456800000000000000c) 3 | ok (0000001240003456800000000000000f) 4 | ok (00000012400034568000000000000012) 5 | ok ((0000001240003456800000000000000f "c" null string "3" null true true 1970-01-01T00:00:00.0015Z)) 6 | ok ((0000001240003456800000000000000c "b" null string "2" null true true 1970-01-01T00:00:00.0012Z)) 7 | error EMPTY "not found" 8 | -------------------------------------------------------------------------------- /test/unit/search.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bty <<-'EOF' 22 | write ("a" value="1") 23 | write ("b" value="2") 24 | write ("c" value="3") 25 | write ("d" value="4") 26 | read ("c") 27 | read (value="2") 28 | read ("nonexistant") 29 | EOF 30 | rm -rf $D 31 | -------------------------------------------------------------------------------- /test/unit/simple.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bty <<-'EOF' 22 | write (type="animal") 23 | write (type="vegetable") 24 | read (any) 25 | EOF 26 | rm -rf $D 27 | -------------------------------------------------------------------------------- /test/unit/sort1.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok (00000012400034568000000000000001) 3 | ok (00000012400034568000000000000002) 4 | ok (00000012400034568000000000000003) 5 | ok ((00000012400034568000000000000002 null "a" string "1" null true true 1970-01-01T00:00:00.0002Z) (00000012400034568000000000000001 null "b" string "2" null true true 1970-01-01T00:00:00.0001Z) (00000012400034568000000000000003 null "c" string "3" null true true 1970-01-01T00:00:00.0003Z) (00000012400034568000000000000000 null "d" string "4" null true true 1970-01-01T00:00:00.0000Z)) 6 | -------------------------------------------------------------------------------- /test/unit/sort10.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000 (00000012400034568000000000000002 (00000012400034568000000000000001)) (00000012400034568000000000000004 (00000012400034568000000000000003)) (00000012400034568000000000000006 (00000012400034568000000000000005)) (00000012400034568000000000000008 (00000012400034568000000000000007)) (0000001240003456800000000000000a (00000012400034568000000000000009)) (0000001240003456800000000000000c (0000001240003456800000000000000b))) 2 | ok (("-2")) 3 | ok (("-2") ("-1")) 4 | ok (("-2") ("-1") ("0")) 5 | ok (("-2") ("-1") ("0") ("1")) 6 | ok (("-2") ("-1") ("0") ("1") ("2")) 7 | ok (("-2") ("-1") ("0") ("1") ("2") ("6")) 8 | -------------------------------------------------------------------------------- /test/unit/sort11.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000 (00000012400034568000000000000001 (0000001240003456800000000000000b) (0000001240003456800000000000000c)) (0000001240003456800000000000000d (0000001240003456800000000000000e) (0000001240003456800000000000000f) (00000012400034568000000000000010)) (00000012400034568000000000000011 (00000012400034568000000000000012))) 2 | ok (((("dad" (("9") ("4") ("1"))) ("mom" (("8") ("3"))) ("auntie" (("5")))))) 3 | -------------------------------------------------------------------------------- /test/unit/sort14.out.exp: -------------------------------------------------------------------------------- 1 | error EMPTY id="bug #3556" "not found" 2 | -------------------------------------------------------------------------------- /test/unit/sort14.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | # sort=(()) 21 | 22 | rm -rf $D 23 | rungraphd -d${D} -bty <<-'EOF' 24 | read id="bug #3556" (sort=(-timestamp) result=(())) 25 | EOF 26 | rm -rf $D 27 | -------------------------------------------------------------------------------- /test/unit/sort15.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000 (00000012400034568000000000000002 (00000012400034568000000000000001)) (00000012400034568000000000000004 (00000012400034568000000000000003)) (00000012400034568000000000000006 (00000012400034568000000000000005)) (00000012400034568000000000000008 (00000012400034568000000000000007)) (0000001240003456800000000000000a (00000012400034568000000000000009)) (0000001240003456800000000000000c (0000001240003456800000000000000b)) (0000001240003456800000000000000e (0000001240003456800000000000000d)) (00000012400034568000000000000010 (0000001240003456800000000000000f))) 2 | ok (("-3.9736") ("-1.0") ("-0.552631578947") ("-0.55") ("-0.5") ("0.5") ("1.0") ("2")) 3 | -------------------------------------------------------------------------------- /test/unit/sort16.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000 (00000012400034568000000000000002 (00000012400034568000000000000001)) (00000012400034568000000000000004 (00000012400034568000000000000003)) (00000012400034568000000000000006 (00000012400034568000000000000005)) (00000012400034568000000000000008 (00000012400034568000000000000007))) 2 | ok (((00000012400034568000000000000003 "28"))) 3 | -------------------------------------------------------------------------------- /test/unit/sort17.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000009) 2 | ok (0000001240003456800000000000000a (0000001240003456800000000000000d) (0000001240003456800000000000000e) (0000001240003456800000000000000f)) 3 | ok (00000012400034568000000000000010 (00000012400034568000000000000011) (00000012400034568000000000000012)) 4 | ok (("A" 0) ("C" 2) ("B" 3)) 5 | -------------------------------------------------------------------------------- /test/unit/sort18.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000 (00000012400034568000000000000001) (00000012400034568000000000000002)) 2 | ok (00000012400034568000000000000003 (00000012400034568000000000000004)) 3 | ok (("B" 1) ("A" 2)) 4 | -------------------------------------------------------------------------------- /test/unit/sort18.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bty <<-'EOF' 22 | write (value="A" 23 | (<-left value="a.1") 24 | (<-left value="a.2")) 25 | write (value="B" 26 | (<-left value="b.1")) 27 | read (pagesize=2 sort=$c result=((value $c)) (<-left $c=count)) 28 | EOF 29 | rm -rf $D 30 | -------------------------------------------------------------------------------- /test/unit/sort19.out.exp: -------------------------------------------------------------------------------- 1 | ok dateline="0000001240003456800000000000000a" (00000012400034568000000000000009) 2 | ok dateline="0000001240003456800000000000000d" (0000001240003456800000000000000c) 3 | ok dateline="00000012400034568000000000000010" (0000001240003456800000000000000f) 4 | ok dateline="00000012400034568000000000000013" (00000012400034568000000000000012) 5 | ok ("sort:[o:2][n:19]s7:HAS_KEYg00000012400034568000000000000002" ("CORE_SCOPE") ("HAS_KEY")) 6 | -------------------------------------------------------------------------------- /test/unit/sort2.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000009) 2 | ok (0000001240003456800000000000000c) 3 | ok (0000001240003456800000000000000f) 4 | ok (00000012400034568000000000000012) 5 | ok ((00000012400034568000000000000009 "d" "x" string "4" null true true 1970-01-01T00:00:00.0009Z) (0000001240003456800000000000000c "b" "x" string "2" null true true 1970-01-01T00:00:00.0012Z) (0000001240003456800000000000000f "a" "x" string "1" null true true 1970-01-01T00:00:00.0015Z) (00000012400034568000000000000012 "c" "x" string "3" null true true 1970-01-01T00:00:00.0018Z)) 6 | -------------------------------------------------------------------------------- /test/unit/sort2.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bty <<-'EOF' 22 | write ("d" value="4" name="x") 23 | write ("b" value="2" name="x") 24 | write ("a" value="1" name="x") 25 | write ("c" value="3" name="x") 26 | read (any sort=() name="x") 27 | EOF 28 | rm -rf $D 29 | -------------------------------------------------------------------------------- /test/unit/sort3.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000009) 2 | ok (0000001240003456800000000000000c) 3 | ok (0000001240003456800000000000000f) 4 | ok (00000012400034568000000000000012) 5 | ok "cursor:c27a:[o:1][n:19]all:0-19/1/" 6 | ok "cursor:c276:[o:1][n:19]all:0-19/2/" 7 | ok "cursor:c272:[o:1][n:19]all:0-19/3/" 8 | -------------------------------------------------------------------------------- /test/unit/sort4.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok (00000012400034568000000000000001) 3 | ok (00000012400034568000000000000002) 4 | ok (00000012400034568000000000000003) 5 | ok ((00000012400034568000000000000002 null "a" string "1" null true true 1970-01-01T00:00:00.0002Z) (00000012400034568000000000000001 null "b" string "2" null true true 1970-01-01T00:00:00.0001Z) (00000012400034568000000000000003 null "c" string "3" null true true 1970-01-01T00:00:00.0003Z) (00000012400034568000000000000000 null "d" string "4" null true true 1970-01-01T00:00:00.0000Z)) 6 | -------------------------------------------------------------------------------- /test/unit/sort5.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000 (00000012400034568000000000000001) (00000012400034568000000000000002)) 2 | ok (((("A") ("C")))) 3 | -------------------------------------------------------------------------------- /test/unit/sort5.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | # Bug courtesy of Tim Sturges. 21 | 22 | rm -rf $D 23 | rungraphd -d${D} -bty <<-'EOF' 24 | write ((-> value="C") (-> value="A")) 25 | read (any result=(($f)) (-> sort=value $f=((value)))) 26 | EOF 27 | rm -rf $D 28 | -------------------------------------------------------------------------------- /test/unit/sort6.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000 (00000012400034568000000000000001)) 2 | ok (00000012400034568000000000000002 (00000012400034568000000000000003)) 3 | ok (00000012400034568000000000000004 (00000012400034568000000000000005)) 4 | ok ((null "name 1" "value 2") ("tag 1" "name 2" null) ("tag 2" null "value 1")) 5 | ok (("tag 2" null "value 1") (null "name 1" "value 2") ("tag 1" "name 2" null)) 6 | ok (("tag 1" "name 2" null) ("tag 2" null "value 1") (null "name 1" "value 2")) 7 | -------------------------------------------------------------------------------- /test/unit/sort7.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok (00000012400034568000000000000001) 3 | ok (("2") ("1")) 4 | ok (("2") ("1")) 5 | ok (("2") ("1")) 6 | error SYNTAX "circular assignment of $foo to itself" 7 | error SYNTAX "circular assignment of $foo to itself" 8 | error SYNTAX "variable $bar is returned, but not set in the constraint or any subconstraint" 9 | error SYNTAX "variable $foo is assigned to twice" 10 | ok ((00000012400034568000000000000001 null null string "1" null true true 1970-01-01T00:00:00.0001Z) (00000012400034568000000000000000 null null string "2" null true true 1970-01-01T00:00:00.0000Z)) 11 | error SYNTAX "cannot sort by nested lists." 12 | error SEMANTICS "result expression \"(value)\" nests lists more than two levels deep" 13 | ok (("1") ("2")) 14 | ok (("2") ("1")) 15 | -------------------------------------------------------------------------------- /test/unit/sort8.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000009 (0000001240003456800000000000000c)) 2 | ok (0000001240003456800000000000000d (0000001240003456800000000000000e)) 3 | ok (0000001240003456800000000000000f (00000012400034568000000000000010)) 4 | ok (("1 value") ("2 value") ("3 value")) 5 | ok (("3 value") ("2 value") ("1 value")) 6 | ok (00000012400034568000000000000013 (00000012400034568000000000000014) (00000012400034568000000000000015)) 7 | ok (00000012400034568000000000000016 (00000012400034568000000000000017) (00000012400034568000000000000018)) 8 | ok (00000012400034568000000000000019 (0000001240003456800000000000001a) (0000001240003456800000000000001b)) 9 | ok (((("1") ("5"))) ((("2") ("6"))) ((("3") ("4")))) 10 | ok (((("1") ("5"))) ((("2") ("6"))) ((("3") ("4")))) 11 | -------------------------------------------------------------------------------- /test/unit/sort9.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000 (00000012400034568000000000000002 (00000012400034568000000000000001)) (00000012400034568000000000000004 (00000012400034568000000000000003)) (00000012400034568000000000000006 (00000012400034568000000000000005)) (00000012400034568000000000000008 (00000012400034568000000000000007)) (0000001240003456800000000000000a (00000012400034568000000000000009)) (0000001240003456800000000000000c (0000001240003456800000000000000b))) 2 | ok (("-2") ("-1") ("0") ("1") ("2") ("6")) 3 | -------------------------------------------------------------------------------- /test/unit/sortcomparators.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok (00000012400034568000000000000001) 3 | ok (00000012400034568000000000000002) 4 | ok (00000012400034568000000000000003) 5 | ok (00000012400034568000000000000004) 6 | ok (00000012400034568000000000000005) 7 | ok (00000012400034568000000000000006) 8 | ok (00000012400034568000000000000007) 9 | ok (00000012400034568000000000000008) 10 | ok (("") ("700") ("80") ("9") ("a") ("A") ("b") ("B") (null)) 11 | ok (("") ("700") ("80") ("9") ("A") ("B") ("a") ("b") (null)) 12 | ok (("") ("9") ("80") ("700") ("a") ("A") ("b") ("B") (null)) 13 | -------------------------------------------------------------------------------- /test/unit/sortcursor.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok (00000012400034568000000000000001) 3 | ok (00000012400034568000000000000002) 4 | ok (00000012400034568000000000000003) 5 | ok ("sort:[o:2][n:4]s1:2s1:bnd2.nnb1b1nt1970-01-01T00:00:00.0001Zg00000012400034568000000000000001" ("1") ("2")) 6 | ok ("null:" ("3") ("4")) 7 | error EMPTY "not found" 8 | -------------------------------------------------------------------------------- /test/unit/source.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok id="bloop" (00000012400034568000000000000001) 3 | error EMPTY id="id-fnarp" "not found" 4 | -------------------------------------------------------------------------------- /test/unit/source.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bty <<-'EOF' 22 | write (name="vegetable") 23 | write id="bloop" (name="random") 24 | read id="id-fnarp" (name="this type does not exist") 25 | EOF 26 | rm -rf $D 27 | -------------------------------------------------------------------------------- /test/unit/spacematch.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok (00000012400034568000000000000001) 3 | ok (00000012400034568000000000000002) 4 | ok ((00000012400034568000000000000001 null null string "A B" null true true 1970-01-01T00:00:00.0001Z) (00000012400034568000000000000002 null null string "A B" null true true 1970-01-01T00:00:00.0002Z)) 5 | ok (00000012400034568000000000000001) 6 | ok (00000012400034568000000000000001) 7 | -------------------------------------------------------------------------------- /test/unit/spacematch.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bty <<-'EOF' 22 | write (value="AB") 23 | write (value="A B") 24 | write (value="A B") 25 | read (value="A B") 26 | write (value="A B" key=(value)) 27 | write (value="A B" key=(value)) 28 | EOF 29 | rm -rf $D 30 | -------------------------------------------------------------------------------- /test/unit/start-twice.err.exp: -------------------------------------------------------------------------------- 1 | ERROR: graphd: server is already running (with process-id NNN). [Startup aborted.] 2 | To stop the old server, run graphd with the -z option. 3 | To start a second server on a different database in parallel, 4 | use a pid-file other than "start-twice.pid" (option -p ). 5 | -------------------------------------------------------------------------------- /test/unit/start-unsorted.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok (00000012400034568000000000000001) 3 | ok (00000012400034568000000000000002) 4 | ok (00000012400034568000000000000003) 5 | ok (("a")) 6 | ok "a" 7 | ok ("b") 8 | ok (("c")) 9 | ok (4 ("d")) 10 | ok (00000012400034568000000000000004 (00000012400034568000000000000006 (00000012400034568000000000000005)) (00000012400034568000000000000008 (00000012400034568000000000000007)) (0000001240003456800000000000000a (00000012400034568000000000000009)) (0000001240003456800000000000000c (0000001240003456800000000000000b))) 11 | ok "a" 12 | ok (("b")) 13 | ok "c" 14 | ok "d" 15 | ok 4 16 | -------------------------------------------------------------------------------- /test/unit/start.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok (00000012400034568000000000000001) 3 | ok (00000012400034568000000000000002) 4 | ok (00000012400034568000000000000003) 5 | ok (("a") ("b") ("c") ("d")) 6 | ok (("b") ("c") ("d")) 7 | error EMPTY "not found" 8 | error EMPTY "not found" 9 | -------------------------------------------------------------------------------- /test/unit/status.out.exp: -------------------------------------------------------------------------------- 1 | ok (true) 2 | ok 3 | ok (true) 4 | ok 5 | ok (false) 6 | ok 7 | ok (false) 8 | ok 9 | ok (true) 10 | -------------------------------------------------------------------------------- /test/unit/status.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bty <<-'EOF' 22 | status (core) 23 | set (core=true) 24 | status (core) 25 | set (core=false) 26 | status (core) 27 | set (sync=false) 28 | status (sync) 29 | set (sync=true) 30 | status (sync) 31 | EOF 32 | rm -rf $D 33 | -------------------------------------------------------------------------------- /test/unit/stror.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok (00000012400034568000000000000001) 3 | ok (00000012400034568000000000000002) 4 | ok (00000012400034568000000000000003) 5 | ok (00000012400034568000000000000004) 6 | ok ((00000012400034568000000000000002 "one three") (00000012400034568000000000000003 "three two") (00000012400034568000000000000004 "three")) 7 | -------------------------------------------------------------------------------- /test/unit/stror.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bty <<-'EOF' 22 | write (value="one") 23 | write (value="two") 24 | write (value="one three") 25 | write (value="three two") 26 | write (value="three") 27 | read (value~=("one two" "three") result=((guid value))) 28 | EOF 29 | rm -rf $D 30 | -------------------------------------------------------------------------------- /test/unit/substring3.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000009) 2 | ok (0000001240003456800000000000000c) 3 | ok (0000001240003456800000000000000f) 4 | ok (00000012400034568000000000000012) 5 | ok (("1" "User: foo") ("2" "User:foo") ("4" "User : foo")) 6 | ok (("1" "User: foo") ("2" "User:foo")) 7 | -------------------------------------------------------------------------------- /test/unit/sync.conf: -------------------------------------------------------------------------------- 1 | database 2 | { 3 | path sync.db 4 | } 5 | 6 | listen tcp 7 | { 8 | port 9999 9 | } 10 | 11 | pid-file sync.pid.tmp 12 | log-file sync.log.tmp 13 | netlog-file sync.nl.tmp 14 | -------------------------------------------------------------------------------- /test/unit/sync2.out.exp: -------------------------------------------------------------------------------- 1 | ok id="1" (00000012400034568000000000000000) 2 | ok id="2" (00000012400034568000000000000001) 3 | ok 4 | ok id="3" (00000012400034568000000000000002) 5 | ok id="4" (00000012400034568000000000000003) 6 | ok 7 | ok id="5" (0000001240003456800000000000000d) 8 | ok id="6" (00000012400034568000000000000010) 9 | ok 10 | ok id="7" (00000012400034568000000000000013) 11 | ok id="8" (00000012400034568000000000000014) 12 | ok ((00000012400034568000000000000000) (00000012400034568000000000000003) (0000001240003456800000000000000c) (00000012400034568000000000000014)) 13 | -------------------------------------------------------------------------------- /test/unit/syntaxerrs.out.exp: -------------------------------------------------------------------------------- 1 | error SEMANTICS "result expression \"(name)\" nests lists more than two levels deep" 2 | error SYNTAX "can only have one nested list per result list - (x (y)) and ((x y)) work, ((x) (y)) doesn't." 3 | -------------------------------------------------------------------------------- /test/unit/threedump.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bty <<-'EOF' 22 | write ("flower" name="vanilla" datatype=string value="yum" 23 | (<- type="smells-like" ("food" name="pudding" value="tapioca"))) 24 | dump () 25 | EOF 26 | rm -rf $D 27 | -------------------------------------------------------------------------------- /test/unit/tiling.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok (00000012400034568000000000000001) 3 | ok ((00000012400034568000000000000000 null "animal" null null null true true 1970-01-01T00:00:00.0000Z) (00000012400034568000000000000001 null "vegetable" null null null true true 1970-01-01T00:00:00.0001Z)) 4 | -------------------------------------------------------------------------------- /test/unit/tiling.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bty <<-'EOF' 22 | write (name="animal") 23 | write (name="vegetable") 24 | read () 25 | EOF 26 | rm -rf $D 27 | -------------------------------------------------------------------------------- /test/unit/timesort.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000009 (0000001240003456800000000000000d (0000001240003456800000000000000c))) 2 | ok (0000001240003456800000000000000e (00000012400034568000000000000010 (0000001240003456800000000000000f))) 3 | ok (00000012400034568000000000000011 (00000012400034568000000000000013 (00000012400034568000000000000012))) 4 | ok (00000012400034568000000000000014 (00000012400034568000000000000016 (00000012400034568000000000000015))) 5 | ok ((1970-01-01T00:00:00.0021Z) (1970-01-01T00:00:00.0018Z) (1970-01-01T00:00:00.0015Z) (1970-01-01T00:00:00.0012Z)) 6 | ok ((1970-01-01T00:00:00.0012Z) (1970-01-01T00:00:00.0015Z) (1970-01-01T00:00:00.0018Z) (1970-01-01T00:00:00.0021Z)) 7 | ok ((1970-01-01T00:00:00.0021Z) (1970-01-01T00:00:00.0018Z) (1970-01-01T00:00:00.0015Z) (1970-01-01T00:00:00.0012Z)) 8 | -------------------------------------------------------------------------------- /test/unit/timestamp-2.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok (00000012400034568000000000000001) 3 | ok (00000012400034568000000000000002) 4 | ok (00000012400034568000000000000003) 5 | ok (00000012400034568000000000000004) 6 | ok (00000012400034568000000000000005) 7 | ok (00000012400034568000000000000006) 8 | ok (00000012400034568000000000000007) 9 | ok (("a") ("b") ("c") ("d") ("e") ("f") ("g") ("h")) 10 | ok (("b") ("c") ("d") ("e") ("f") ("g") ("h")) 11 | ok (("c") ("d") ("e") ("f") ("g") ("h")) 12 | ok (("d") ("e") ("f") ("g") ("h")) 13 | ok (("e") ("f") ("g") ("h")) 14 | ok (("f") ("g") ("h")) 15 | ok (("g") ("h")) 16 | ok (("h")) 17 | -------------------------------------------------------------------------------- /test/unit/timestamp-3.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok (00000012400034568000000000000001) 3 | ok (("a" 1970-01-01T00:00:00.0000Z) ("b" 1970-01-01T00:00:00.0001Z)) 4 | ok (("b" 1970-01-01T00:00:00.0001Z)) 5 | error EMPTY "not found" 6 | -------------------------------------------------------------------------------- /test/unit/timestamp-4.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok (("a" 1970-01-01T00:00:00.0000Z)) 3 | ok (("a" 1970-01-01T00:00:00.0000Z)) 4 | ok (("a" 1970-01-01T00:00:00.0000Z)) 5 | ok (("a" 1970-01-01T00:00:00.0000Z)) 6 | ok (("a" 1970-01-01T00:00:00.0000Z)) 7 | ok (("a" 1970-01-01T00:00:00.0000Z)) 8 | ok (("a" 1970-01-01T00:00:00.0000Z)) 9 | ok (("a" 1970-01-01T00:00:00.0000Z)) 10 | ok (("a" 1970-01-01T00:00:00.0000Z)) 11 | ok (("a" 1970-01-01T00:00:00.0000Z)) 12 | ok (("a" 1970-01-01T00:00:00.0000Z)) 13 | ok (("a" 1970-01-01T00:00:00.0000Z)) 14 | ok (("a" 1970-01-01T00:00:00.0000Z)) 15 | ok (("a" 1970-01-01T00:00:00.0000Z)) 16 | -------------------------------------------------------------------------------- /test/unit/timestamp.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok (00000012400034568000000000000001) 3 | ok ((1970-01-01T00:00:00.0000Z) (1970-01-01T00:00:00.0001Z)) 4 | ok ((1970-01-01T00:00:00.0000Z)) 5 | ok ((1970-01-01T00:00:00.0000Z)) 6 | ok ((1970-01-01T00:00:00.0001Z)) 7 | ok ((1970-01-01T00:00:00.0001Z)) 8 | ok ((1970-01-01T00:00:00.0001Z)) 9 | ok (00000012400034568000000000000002) 10 | ok ((1970-01-02T03:04:05.0006Z)) 11 | error SEMANTICS "on line 1, column 30: '190-01-02T03:04:05.0006': expected a timestamp value" 12 | -------------------------------------------------------------------------------- /test/unit/trailer.out.exp: -------------------------------------------------------------------------------- 1 | ok dateline="00000012400034568000000000000012" (00000012400034568000000000000009 (0000001240003456800000000000000b (0000001240003456800000000000000a)) (0000001240003456800000000000000d (0000001240003456800000000000000c)) (0000001240003456800000000000000e) (0000001240003456800000000000000f) (00000012400034568000000000000011 (00000012400034568000000000000010))) 2 | ok dateline="00000012400034568000000000000021" (00000012400034568000000000000009 (00000012400034568000000000000013 (00000012400034568000000000000012)) (00000012400034568000000000000015 (00000012400034568000000000000014)) (00000012400034568000000000000017 (00000012400034568000000000000016)) (00000012400034568000000000000019 (00000012400034568000000000000018)) (0000001240003456800000000000001b (0000001240003456800000000000001a)) (0000001240003456800000000000001d (0000001240003456800000000000001c)) (0000001240003456800000000000001f (0000001240003456800000000000001e)) (00000012400034568000000000000020)) 3 | ok (("u") ("v") ("w") ("x") ("y")) 4 | -------------------------------------------------------------------------------- /test/unit/triad.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000009 (0000001240003456800000000000000f (0000001240003456800000000000000e))) 2 | ok "d" 3 | -------------------------------------------------------------------------------- /test/unit/triad.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bty <<-'EOF' 22 | write ("a" (-> "b" ("c" value="d"))) 23 | read ("a" result=$avar (-> "b" $avar=$bvar ("c" $bvar=value))) 24 | EOF 25 | rm -rf $D 26 | -------------------------------------------------------------------------------- /test/unit/twovars.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000009 (0000001240003456800000000000000d (0000001240003456800000000000000c)) (00000012400034568000000000000011 (00000012400034568000000000000010))) 2 | ok (00000012400034568000000000000012 (00000012400034568000000000000014 (00000012400034568000000000000013)) (00000012400034568000000000000016 (00000012400034568000000000000015))) 3 | ok (00000012400034568000000000000017 (00000012400034568000000000000019 (00000012400034568000000000000018)) (0000001240003456800000000000001b (0000001240003456800000000000001a))) 4 | ok (("3" "3")) 5 | -------------------------------------------------------------------------------- /test/unit/typeandtypeguid.out.exp: -------------------------------------------------------------------------------- 1 | error SEMANTICS "can't have a type and a typeguid in the same write request." 2 | -------------------------------------------------------------------------------- /test/unit/typeandtypeguid.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bty <<-'EOF' 22 | write (type="fruitbat" typeguid=00000012400034568000000000000000) 23 | EOF 24 | rm -rf $D 25 | -------------------------------------------------------------------------------- /test/unit/typo.out.exp: -------------------------------------------------------------------------------- 1 | error SEMANTICS "on line 1, column 16: 'nmae': invalid constraint" 2 | -------------------------------------------------------------------------------- /test/unit/typo.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | rungraphd -d${D} -bty <<-'EOF' 22 | write ("elder" nmae="cthulhu") 23 | EOF 24 | rm -rf $D 25 | -------------------------------------------------------------------------------- /test/unit/unique1.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok (00000012400034568000000000000001) 3 | error EXISTS "primitive tagged as unique already exist" 4 | -------------------------------------------------------------------------------- /test/unit/unique1.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $B 21 | rungraphd -d${B} -bty <<-EOF 22 | write (name="foo") 23 | write (name="bar") 24 | write (name="bar" unique=(name)) 25 | EOF 26 | rm -rf $B 27 | -------------------------------------------------------------------------------- /test/unit/unique2.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000 (00000012400034568000000000000002 (00000012400034568000000000000001))) 2 | error EXISTS "primitive tagged as unique already exist" 3 | ok (00000012400034568000000000000003) 4 | ok (00000012400034568000000000000004) 5 | error EXISTS "primitive tagged as unique already exist" 6 | -------------------------------------------------------------------------------- /test/unit/unique3.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok (00000012400034568000000000000001) 3 | ok (00000012400034568000000000000002) 4 | ok (00000012400034568000000000000003) 5 | -------------------------------------------------------------------------------- /test/unit/unique4.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000009) 2 | ok (0000001240003456800000000000000a) 3 | error EMPTY "not found" 4 | ok (0000001240003456800000000000000a (0000001240003456800000000000000b (00000012400034568000000000000009))) 5 | ok (0000001240003456800000000000000c (0000001240003456800000000000000e (0000001240003456800000000000000d))) 6 | ok (0000001240003456800000000000000a (00000012400034568000000000000011 (00000012400034568000000000000009))) 7 | ok (00000012400034568000000000000014) 8 | ok (00000012400034568000000000000014) 9 | -------------------------------------------------------------------------------- /test/unit/unique6.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000 (00000012400034568000000000000001)) 2 | ok (00000012400034568000000000000002) 3 | ok (00000012400034568000000000000003 (00000012400034568000000000000004 (00000012400034568000000000000002))) 4 | ok (00000012400034568000000000000000 (00000012400034568000000000000001) (00000012400034568000000000000005 (00000012400034568000000000000002))) 5 | ok (00000012400034568000000000000000 (00000012400034568000000000000001) (00000012400034568000000000000006 (00000012400034568000000000000002))) 6 | -------------------------------------------------------------------------------- /test/unit/valuetype.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok (00000012400034568000000000000001) 3 | ok (00000012400034568000000000000002) 4 | ok (00000012400034568000000000000003) 5 | ok (00000012400034568000000000000004) 6 | ok (00000012400034568000000000000005) 7 | ok (00000012400034568000000000000006) 8 | ok (00000012400034568000000000000007) 9 | ok (00000012400034568000000000000008) 10 | ok (00000012400034568000000000000009) 11 | ok (0000001240003456800000000000000a) 12 | ok (0000001240003456800000000000000b) 13 | error SEMANTICS "on line 1, column 27: '0': invalid datatype" 14 | ok (0000001240003456800000000000000c) 15 | error SEMANTICS "on line 1, column 28: '256': invalid datatype" 16 | ok (0000001240003456800000000000000d) 17 | ok (("1" 1 null) ("2" 2 string) ("3" 3 integer) ("4" 4 float) ("5" 5 guid) ("6" 6 timestamp) ("7" 7 url) ("8" 8 bytestring) ("9" 9 boolean) ("10" 10 10) ("11" 11 11) ("200" 200 200) ("201" 201 201) ("string" 2 string)) 18 | -------------------------------------------------------------------------------- /test/unit/varerrs.out.exp: -------------------------------------------------------------------------------- 1 | error SYNTAX "variable $foo is returned, but not set in the constraint or any subconstraint" 2 | error SYNTAX "variable $foo is assigned, but not returned in this or any containing constraint" 3 | error SEMANTICS "on line 1, column 40: ')': unknown subconstraint linkage" 4 | -------------------------------------------------------------------------------- /test/unit/varor.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok (00000012400034568000000000000001) 3 | ok (00000012400034568000000000000002) 4 | ok ((null) (banana) (apple)) 5 | -------------------------------------------------------------------------------- /test/unit/vars.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000009 (0000001240003456800000000000000d (0000001240003456800000000000000c)) (0000001240003456800000000000000f (0000001240003456800000000000000e)) (00000012400034568000000000000011 (00000012400034568000000000000010)) (00000012400034568000000000000013 (00000012400034568000000000000012)) (00000012400034568000000000000015 (00000012400034568000000000000014))) 2 | ok (("Monera") ("Protista") ("Fungi") ("Plantae") ("Animalia")) 3 | -------------------------------------------------------------------------------- /test/unit/vars2.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok (00000012400034568000000000000001) 3 | ok (00000012400034568000000000000002) 4 | error SYNTAX "can only have one nested list per result list - (x (y)) and ((x y)) work, ((x) (y)) doesn't." 5 | error SYNTAX "can only have one nested list per result list - (x (y)) and ((x y)) work, ((x) (y)) doesn't." 6 | -------------------------------------------------------------------------------- /test/unit/vars2.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D 21 | 22 | rungraphd -d${D} -bty <<-'EOF' 23 | write (name="a" value="1") 24 | write (name="b" value="2") 25 | write (name="c" value="3") 26 | read (result=((name) (value))) 27 | read (result=($a $b) $a=(name) $b=(value)) 28 | EOF 29 | 30 | rm -rf $D 31 | -------------------------------------------------------------------------------- /test/unit/varsort.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000 (00000012400034568000000000000001)) 2 | ok (00000012400034568000000000000002 (00000012400034568000000000000003)) 3 | ok (00000012400034568000000000000004 (00000012400034568000000000000005)) 4 | ok (("1" "a") ("2" "b") ("3" "c")) 5 | ok ((a "c") (b "b") (c "a")) 6 | ok ((a "c") (b "b") (c "a")) 7 | -------------------------------------------------------------------------------- /test/unit/version2.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000009 (0000001240003456800000000000000f (0000001240003456800000000000000e))) 2 | ok (00000012400034568000000000000010 (00000012400034568000000000000012 (00000012400034568000000000000011))) 3 | ok (("angler")) 4 | ok (00000012400034568000000000000014 (00000012400034568000000000000013)) 5 | ok (00000012400034568000000000000016 (00000012400034568000000000000015)) 6 | ok (("tuna")) 7 | -------------------------------------------------------------------------------- /test/unit/version4.out.exp: -------------------------------------------------------------------------------- 1 | error SEMANTICS "not found: cannot read predecessor record 00000012400034568000000000000013" 2 | -------------------------------------------------------------------------------- /test/unit/version4.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | # use a GUID that doesn't actually exist as a 21 | # versioning source. 22 | 23 | rm -rf $D 24 | rungraphd -d${D} -bty <<-'EOF' 25 | write (guid ~= 00000012400034568000000000000013 name="Hello, Moon!") 26 | EOF 27 | rm -rf $D 28 | -------------------------------------------------------------------------------- /test/unit/version5.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000009) 2 | ok (0000001240003456800000000000000c) 3 | ok 2 4 | -------------------------------------------------------------------------------- /test/unit/version7.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok (00000012400034568000000000000001) 3 | ok (00000012400034568000000000000002) 4 | ok (00000012400034568000000000000003) 5 | ok (00000012400034568000000000000004) 6 | ok (("foo" 00000012400034568000000000000003) ("bar" 00000012400034568000000000000004)) 7 | -------------------------------------------------------------------------------- /test/unit/will1.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000009 (0000001240003456800000000000000f (0000001240003456800000000000000e)) (00000012400034568000000000000015 (00000012400034568000000000000014))) 2 | ok (00000012400034568000000000000016 (00000012400034568000000000000018 (00000012400034568000000000000017)) (0000001240003456800000000000001a (00000012400034568000000000000019))) 3 | ok (0000001240003456800000000000001b (0000001240003456800000000000001d (0000001240003456800000000000001c)) (0000001240003456800000000000001f (0000001240003456800000000000001e))) 4 | error EMPTY "not found" 5 | -------------------------------------------------------------------------------- /test/unit/will2.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok (00000012400034568000000000000001) 3 | ok (00000012400034568000000000000002) 4 | -------------------------------------------------------------------------------- /test/unit/will2.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D $B.pid 21 | # $ts > 2005-05-06T02:20:34.0009, 22 | 23 | rungraphd -d${D} -p${B}.pid -bty << 'EOF' 24 | write () 25 | write (<- right=00000012400034568000000000000000) 26 | write (<- left=00000012400034568000000000000000) 27 | EOF 28 | rm -rf $D $B.pid 29 | -------------------------------------------------------------------------------- /test/unit/will3.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | rm -rf $D $B.pid 21 | rungraphd -d${D} -pwill3.pid -bty << 'EOF' 22 | write ((-> (value="metrofoo"))) 23 | write ((-> (value="muttrfoo"))) 24 | write ((-> (value="metroblah"))) 25 | read ((-> (value~="metro*"))) 26 | read ((-> (value~="metr*"))) 27 | EOF 28 | rm -rf $D $B.pid 29 | -------------------------------------------------------------------------------- /test/unit/will4.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000009 (0000001240003456800000000000000f (0000001240003456800000000000000e))) 2 | ok ((00000012400034568000000000000009 "object" null null null null true true 1970-01-01T00:00:00.0009Z ((-> 0000001240003456800000000000000f "attribute" "name" null null null true true 1970-01-01T00:00:00.0015Z 0000001240003456800000000000000e 00000012400034568000000000000009 ((0000001240003456800000000000000e "literal" null string "my name" null true true 1970-01-01T00:00:00.0014Z)))))) 3 | ok (00000012400034568000000000000011 (00000012400034568000000000000010)) 4 | ok ((00000012400034568000000000000009 "object" null null null null true true 1970-01-01T00:00:00.0009Z ((-> 00000012400034568000000000000011 "attribute" null null null null true true 1970-01-01T00:00:00.0017Z 00000012400034568000000000000010 00000012400034568000000000000009 ((00000012400034568000000000000010 "literal" null string "new name" null true true 1970-01-01T00:00:00.0016Z)))))) 5 | -------------------------------------------------------------------------------- /test/unit/will5.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000009 (0000001240003456800000000000000f (0000001240003456800000000000000e))) 2 | ok (00000012400034568000000000000010 (00000012400034568000000000000012 (00000012400034568000000000000011))) 3 | ok ("cursor:fa41:[o:1][n:19]gmap:15-19:t->10/1/" (0000001240003456800000000000000f "one" null)) 4 | ok ("null:" (00000012400034568000000000000012 "two" null)) 5 | error EMPTY "not found" 6 | -------------------------------------------------------------------------------- /test/unit/will8.out.exp: -------------------------------------------------------------------------------- 1 | error SEMANTICS dateline="00000012400034568000000000000000" "on line 7, column 47: ')': unknown subconstraint linkage" 2 | -------------------------------------------------------------------------------- /test/unit/without.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok (00000012400034568000000000000001) 3 | ok (00000012400034568000000000000002) 4 | ok (00000012400034568000000000000003) 5 | ok ("cursor:d3bd:[o:1][n:4]all:0-4/1/" (null)) 6 | ok ("cursor:7018:[o:1][n:4]without:(all:0-4)#(any-value)/2/0:-:()-" (null)) 7 | ok ("null:" (null)) 8 | -------------------------------------------------------------------------------- /test/unit/wordnet1.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000009 (0000001240003456800000000000000d (0000001240003456800000000000000c))) 2 | ok ((("A" "B"))) 3 | -------------------------------------------------------------------------------- /test/unit/writeresult.out.exp: -------------------------------------------------------------------------------- 1 | ok (00000012400034568000000000000000) 2 | ok 3 | ok Hello, World! 4 | ok (((*** boing ***))) 5 | ok (00000012400034568000000000000004 00000012400034568000000000000004 00000012400034568000000000000004) 6 | ok Hello, World! 7 | ok (00000012400034568000000000000008 Hello, World!) 8 | ok (0000001240003456800000000000000b Hello, World!) 9 | error SEMANTICS "cannot use value as a write result, only literal=, guid, contents, or none" 10 | ok (0000001240003456800000000000000e (0000001240003456800000000000000f)) 11 | ok (00000012400034568000000000000010) 12 | -------------------------------------------------------------------------------- /test/unit/yesno.out.exp: -------------------------------------------------------------------------------- 1 | error SEMANTICS "on line 1, column 20: '->': a meta constraint has already been defined" 2 | error SEMANTICS "duplicate assignment to \"archival\" flag" 3 | error SEMANTICS "duplicate assignment to \"live\" flag" 4 | error SYNTAX "more than one value for \"name\"" 5 | error SYNTAX "on line 1, column 14: '5': expected a string or '('" 6 | error SEMANTICS "more than one valuetype" 7 | error EMPTY "not found" 8 | -------------------------------------------------------------------------------- /test/unit/zeroguid.out.exp: -------------------------------------------------------------------------------- 1 | error EMPTY "not found" 2 | -------------------------------------------------------------------------------- /test/unit/zeroguid.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | #!/bin/bash 15 | 16 | B=`basename $0 .sh` 17 | cd `dirname $0` 18 | source ./rungraphd 19 | 20 | # just one of those weird cases that come out of random testing. 21 | 22 | rm -rf $D 23 | rungraphd -d${D} -bty << 'EOF' 24 | read (guid = 0) 25 | EOF 26 | rm -rf $D 27 | -------------------------------------------------------------------------------- /util/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | cc_binary( 4 | name = "gpush", 5 | srcs = [ 6 | "gpush.c", 7 | ], 8 | copts = [ 9 | "$(STACK_FRAME_UNLIMITED)", 10 | "-g", 11 | "-w", 12 | ], 13 | deps = [ 14 | "//libcl", 15 | "//libcm", 16 | "//libgraph", 17 | "//libgraphdb", 18 | ], 19 | ) 20 | --------------------------------------------------------------------------------