--- /dev/null
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <vector>
+#include <iostream>
+
+#include <snapper/Snapper.h>
+
+using namespace snapper;
+using namespace std;
+
+
+void
+deleteAll()
+{
+ Snapper* sh = new Snapper("testsuite");
+
+ Snapshots snapshots = sh->getSnapshots();
+
+ vector<Snapshots::iterator> tmp;
+ for (Snapshots::iterator it = snapshots.begin(); it != snapshots.end(); ++it)
+ if (!it->isCurrent())
+ tmp.push_back(it);
+
+ for (vector<Snapshots::iterator>::iterator it = tmp.begin(); it != tmp.end(); ++it)
+ sh->deleteSnapshot(*it);
+
+ delete sh;
+}
+
+
+int
+main()
+{
+ deleteAll();
+
+ Snapper* sh = new Snapper("testsuite");
+
+ for (size_t i = 0; i < 100; ++i)
+ {
+ map<string, string> userdata;
+ if (i % 5 == 0)
+ userdata["important"] = "yes";
+
+ sh->createSingleSnapshot(getuid(), "testsuite", "number", userdata);
+ }
+
+ delete sh;
+
+ exit(EXIT_SUCCESS);
+}
#include <stdlib.h>
+#include <unistd.h>
+#include <sys/types.h>
#include <vector>
#include <iostream>
time_t t = time(NULL) - 100 * 24*60*60;
while (t < time(NULL))
{
- Snapshots::iterator snap = sh->createSingleSnapshot("testsuite");
+ Snapshots::iterator snap = sh->createSingleSnapshot(getuid(), "testsuite", "timeline",
+ map<string, string>());
// snap->setDate(t);
- snap->setCleanup("timeline");
t += 60*60;
}
LDADD = ../../snapper/libsnapper.la
-noinst_PROGRAMS = List ListAll Create CmpDirs CreateTimeline SnapTest
+noinst_PROGRAMS = List ListAll Create CmpDirs CreateNumber CreateTimeline SnapTest
List_SOURCES = List.cc
CmpDirs_SOURCES = CmpDirs.cc
+CreateNumber_SOURCES = CreateNumber.cc
+
CreateTimeline_SOURCES = CreateTimeline.cc
SnapTest_SOURCES = SnapTest.cc