mirror of
https://github.com/maxDcb/C2Core
synced 2026-06-08 15:48:01 +00:00
25 lines
609 B
C++
25 lines
609 B
C++
#include "../ListProcesses.hpp"
|
|
#include "../../tests/TestHelpers.hpp"
|
|
|
|
#include <iostream>
|
|
#include <vector>
|
|
|
|
using namespace test_helpers;
|
|
|
|
int main()
|
|
{
|
|
bool ok = true;
|
|
|
|
ListProcesses module;
|
|
std::vector<std::string> cmd = {"ps"};
|
|
C2Message message;
|
|
C2Message ret;
|
|
|
|
ok &= expect(module.init(cmd, message) == 0, "init should accept process listing command");
|
|
ok &= expect(message.instruction() == "ps", "instruction should be set");
|
|
module.process(message, ret);
|
|
ok &= expect(!ret.returnvalue().empty(), "process listing should produce output");
|
|
|
|
return ok ? 0 : 1;
|
|
}
|