open source driving agent
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
739 B

#define CATCH_CONFIG_MAIN
#include "catch2/catch.hpp"
#include "selfdrive/ui/replay/framereader.h"
const char *stream_url = "https://commadataci.blob.core.windows.net/openpilotci/0c94aa1e1296d7c6/2021-05-05--19-48-37/0/fcamera.hevc";
TEST_CASE("FrameReader") {
SECTION("process&get") {
FrameReader fr;
REQUIRE(fr.load(stream_url) == true);
REQUIRE(fr.valid() == true);
REQUIRE(fr.getFrameCount() == 1200);
// random get 50 frames
// srand(time(NULL));
// for (int i = 0; i < 50; ++i) {
// int idx = rand() % (fr.getFrameCount() - 1);
// REQUIRE(fr.get(idx) != nullptr);
// }
// sequence get 50 frames {
for (int i = 0; i < 50; ++i) {
REQUIRE(fr.get(i) != nullptr);
}
}
}