summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorZdenek Prikryl <zprikryl@redhat.com>2009-02-12 10:00:21 +0100
committerZdenek Prikryl <zprikryl@redhat.com>2009-02-12 10:00:21 +0100
commit66bdd03d7892cd95e7806b8c375e88d279dd4034 (patch)
treee1c0a637252f4d183ef37d3b502e56e7831264a7 /lib
parente935c9e8a7208f04af8fce1e32e8c8d8c52beca5 (diff)
downloadabrt-66bdd03d7892cd95e7806b8c375e88d279dd4034.tar.gz
abrt-66bdd03d7892cd95e7806b8c375e88d279dd4034.tar.xz
abrt-66bdd03d7892cd95e7806b8c375e88d279dd4034.zip
more complex testcase
Diffstat (limited to 'lib')
-rw-r--r--lib/MiddleWare/test.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/lib/MiddleWare/test.cpp b/lib/MiddleWare/test.cpp
index 016dd9d1..1868284a 100644
--- a/lib/MiddleWare/test.cpp
+++ b/lib/MiddleWare/test.cpp
@@ -35,15 +35,15 @@ int main(int argc, char** argv)
CMiddleWare middleWare(PLUGINS_CONF_DIR,
PLUGINS_LIB_DIR,
std::string(CONF_DIR) + "/CrashCatcher.conf");
+ /* Create DebugDump */
CDebugDump dd;
-
char pid[100];
sprintf(pid, "%d", getpid());
-
dd.Create(std::string(DEBUG_DUMPS_DIR)+"/"+pid, pid);
dd.SaveText(FILENAME_LANGUAGE, "CCpp");
dd.SaveBinary(FILENAME_BINARYDATA1, "ass0-9as", sizeof("ass0-9as"));
+ /* Try to save it into DB */
CMiddleWare::crash_info_t info;
if (middleWare.SaveDebugDump(std::string(DEBUG_DUMPS_DIR)+"/"+pid, info))
{
@@ -52,7 +52,18 @@ int main(int argc, char** argv)
info.m_sPackage << ": " <<
info.m_sExecutable << std::endl;
- middleWare.Report(info.m_sUUID, info.m_sUID);
+ /* Get Report, so user can change data (remove private stuff)
+ *
+ * If we want to send report immediately after DebugDump was created,
+ * we can use:
+ * middleWare.CreateReport(debugDumpDir, crashReport);
+ * and after that it can be easily reported by:
+ * middleWare.Report(crashReport);
+ */
+ CMiddleWare::crash_report_t crashReport;
+ middleWare.CreateReport(info.m_sUUID, info.m_sUID, crashReport);
+ /* Report crash */
+ middleWare.Report(crashReport);
}
}
catch (std::string sError)