Skip to content

Commit

Permalink
Also fix C package tests
Browse files Browse the repository at this point in the history
  • Loading branch information
woodfell committed Nov 13, 2023
1 parent 4686a62 commit a04cd75
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
12 changes: 6 additions & 6 deletions c/test_package/legacy.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <cstdio>
#include <iostream>

#include <libsbp/cpp/state.h>
#include <libsbp/legacy/cpp/legacy_state.h>
#include <libsbp/legacy/cpp/frame_handler.h>

struct FileBase {
Expand Down Expand Up @@ -52,7 +52,7 @@ class FileWriter : public FileBase, public sbp::IWriter {

class MessageHandler : public sbp::AllFrameHandler {
public:
MessageHandler(sbp::State *input_state, sbp::State *output_state) : AllFrameHandler(input_state),
MessageHandler(sbp::LegacyState *input_state, sbp::LegacyState *output_state) : AllFrameHandler(input_state),
output_state_(output_state) {}

void handle_sbp_frame(uint16_t sender_id, uint16_t message_type, uint8_t payload_length, uint8_t *payload,
Expand All @@ -64,7 +64,7 @@ class MessageHandler : public sbp::AllFrameHandler {
}

private:
sbp::State *const output_state_;
sbp::LegacyState *const output_state_;
};

int main() {
Expand All @@ -81,8 +81,8 @@ int main() {
return EXIT_FAILURE;
}

sbp::State input_state(&input_file, nullptr);
sbp::State output_state(nullptr, &output_file);
sbp::LegacyState input_state(&input_file, nullptr);
sbp::LegacyState output_state(nullptr, &output_file);
MessageHandler message_handler(&input_state, &output_state);

s8 ret = 0;
Expand All @@ -107,4 +107,4 @@ int main() {
}

return EXIT_SUCCESS;
}
}
3 changes: 1 addition & 2 deletions c/test_package/v4.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <libsbp/sbp.h>
#include <libsbp/v4/api.h>

struct Context {
FILE *input_file;
Expand Down Expand Up @@ -88,4 +87,4 @@ int main() {
fclose(context.output_file);

return exit_code;
}
}

0 comments on commit a04cd75

Please sign in to comment.