Skip to content

Commit

Permalink
Release 1.0 of the flight recorder
Browse files Browse the repository at this point in the history
  • Loading branch information
c3d committed Aug 4, 2017
1 parent f82e910 commit 648c7ea
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
12 changes: 12 additions & 0 deletions recorder.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,18 @@ extern "C" {
#endif // __cplusplus


// ============================================================================
//
// Information about the API
//
// ============================================================================

#define RECORDER_CURRENT_VERSION RECORDER_VERSION(1,0)
#define RECORDER_VERSION(major,minor) ((major)<<16|(minor))
#define RECORDER_VERSION_MAJOR(version) (((version) >> 16) & 0xFFFF)
#define RECORDER_VERSION_MINOR(version) ((version) & 0xFFFF)



// ============================================================================
//
Expand Down
7 changes: 7 additions & 0 deletions recorder_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,13 @@ void flight_recorder_test(int argc, char **argv)
uintptr_t count = argc >= 2 ? atoi(argv[1]) : 16;
unsigned howLong = argc >= 3 ? atoi(argv[2]) : 1;

INFO("Testing recorder version %u.%u",
RECORDER_VERSION_MAJOR(RECORDER_CURRENT_VERSION),
RECORDER_VERSION_MINOR(RECORDER_CURRENT_VERSION));
if (RECORDER_CURRENT_VERSION > RECORDER_VERSION(1,0))
FAIL("Testing an unexpected version of the recorder, "
"update RECORDER_CURRENT_VERSION");

for (i = 0; i < 2; i++)
{
recorder_count = 0;
Expand Down

0 comments on commit 648c7ea

Please sign in to comment.