diff options
| author | Zdenek Prikryl <zdeny@dhcp-lab-218.englab.brq.redhat.com> | 2009-04-02 17:38:37 +0200 |
|---|---|---|
| committer | Zdenek Prikryl <zdeny@dhcp-lab-218.englab.brq.redhat.com> | 2009-04-02 17:38:37 +0200 |
| commit | f1e38ce849b56d58f6227f09cffc46dd1fafe0b1 (patch) | |
| tree | 1c8ad7c5cd14b1c2f396df9e235d0f2a92c02a17 /lib | |
| parent | 62a15a2e7cc5186661bef2ec172422989c72e5db (diff) | |
| download | abrt-f1e38ce849b56d58f6227f09cffc46dd1fafe0b1.tar.gz abrt-f1e38ce849b56d58f6227f09cffc46dd1fafe0b1.tar.xz abrt-f1e38ce849b56d58f6227f09cffc46dd1fafe0b1.zip | |
updated test and fixed crash types
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/MiddleWare/CrashTypes.h | 4 | ||||
| -rw-r--r-- | lib/MiddleWare/test.cpp | 27 |
2 files changed, 21 insertions, 10 deletions
diff --git a/lib/MiddleWare/CrashTypes.h b/lib/MiddleWare/CrashTypes.h index 81e1612..6cef6f7 100644 --- a/lib/MiddleWare/CrashTypes.h +++ b/lib/MiddleWare/CrashTypes.h @@ -51,8 +51,8 @@ inline void add_crash_data_to_crash_info(map_crash_info_t& pCrashInfo, const content_crash_data_t& pType, const std::string& pContent) { - pCrashInfo[type_crash_data_t_str[pItem]].push_back(type_crash_data_t_str[pType]); - pCrashInfo[type_crash_data_t_str[pItem]].push_back(pContent); + pCrashInfo[item_crash_into_t_str[pItem]].push_back(type_crash_data_t_str[pType]); + pCrashInfo[item_crash_into_t_str[pItem]].push_back(pContent); } inline void add_crash_data_to_crash_report(map_crash_report_t& pCrashReport, diff --git a/lib/MiddleWare/test.cpp b/lib/MiddleWare/test.cpp index 8f5afc9..9422b0b 100644 --- a/lib/MiddleWare/test.cpp +++ b/lib/MiddleWare/test.cpp @@ -37,24 +37,35 @@ int main(int argc, char** argv) } try { + //std::string(CONF_DIR) + "/abrt.conf" CMiddleWare middleWare(PLUGINS_CONF_DIR, - PLUGINS_LIB_DIR, - std::string(CONF_DIR) + "/abrt.conf"); + PLUGINS_LIB_DIR); /* Create DebugDump */ /* Try to save it into DB */ - crash_info_t crashInfo; + middleWare.RegisterPlugin("CCpp"); + middleWare.RegisterPlugin("Logger"); + middleWare.RegisterPlugin("RunApp"); + middleWare.RegisterPlugin("SQLite3"); + middleWare.SetDatabase("SQLite3"); + middleWare.SetOpenGPGCheck(false); + middleWare.AddAnalyzerReporter("CCpp", "Logger"); + middleWare.AddAnalyzerAction("CCpp", "RunApp", "date,action_date"); + std::cout << "sasas" <<std::endl; + map_crash_info_t crashInfo; if (middleWare.SaveDebugDump(argv[1], crashInfo)) { std::cout << "Application Crashed! " << - "(" << crashInfo.m_sTime << " [" << crashInfo.m_sCount << "]) " << - crashInfo.m_sPackage << ": " << - crashInfo.m_sExecutable << std::endl; + crashInfo[item_crash_into_t_str[CI_PACKAGE]][CD_CONTENT] << ", " << + crashInfo[item_crash_into_t_str[CI_EXECUTABLE]][CD_CONTENT] << ", " << + crashInfo[item_crash_into_t_str[CI_COUNT]][CD_CONTENT] << ", " << std::endl; /* Get Report, so user can change data (remove private stuff) * If we do not want user interaction, just send data immediately */ - crash_report_t crashReport; - middleWare.CreateCrashReport(crashInfo.m_sUUID, crashInfo.m_sUID, crashReport); + map_crash_report_t crashReport; + middleWare.CreateCrashReport(crashInfo[item_crash_into_t_str[CI_UUID]][CD_CONTENT], + crashInfo[item_crash_into_t_str[CI_UID]][CD_CONTENT], + crashReport); /* Report crash */ middleWare.Report(crashReport); } |
