diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-06-01 20:54:59 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-06-01 20:54:59 +0200 |
| commit | e27289ebb14c1004136bd9fd8f05a9a189bf9d92 (patch) | |
| tree | 87cb32e7f4d25d4e5a4c18633f343cf3a002f32c /test/mock_grok.cc | |
| parent | 437a0f28eac4464ffec24c83c0b6a767495a415e (diff) | |
wip: test grok when it goes wrong.3039-grok-error
Diffstat (limited to 'test/mock_grok.cc')
| -rw-r--r-- | test/mock_grok.cc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/test/mock_grok.cc b/test/mock_grok.cc index 9abc656e2..a89feefa6 100644 --- a/test/mock_grok.cc +++ b/test/mock_grok.cc @@ -123,6 +123,13 @@ int main(int argc, char* argv[]) boost::algorithm::split(parameters, argv[2], boost::is_any_of(",")); std::cout << "Parameters: " << argv[2] << "\n"; + string licence; + if (argc >= 12) { + licence = argv[12]; + } + + std::cout << "Licence: " << licence << "\n"; + if (parameters.size() != 6) { std::cerr << "Unexpected parameter count.\n"; exit(EXIT_FAILURE); @@ -223,7 +230,9 @@ int main(int argc, char* argv[]) int const dcp_frame = dcp::raw_convert<int>(parameters[1]); int const frame_id = dcp::raw_convert<int>(parameters[2]); send(fmt::format("{},{}", GROK_PROCESSED_UNCOMPRESSED, frame_id).c_str()); - send(fmt::format("{},{},{},{}", GROK_SUBMIT_COMPRESSED, dcp_frame, frame_id, j2k.size()).c_str()); + if (licence == "random_drop" && (rand() % 16 != 0)) { + send(fmt::format("{},{},{},{}", GROK_SUBMIT_COMPRESSED, dcp_frame, frame_id, j2k.size()).c_str()); + } } else if (parameters[0] == GROK_SHUTDOWN) { break; } |
