Sunshine/tests/unit/test_rswrapper.cpp
ns6089 764ce03520
Some checks failed
CI / GitHub Env Debug (push) Waiting to run
CI / Setup Release (push) Waiting to run
CI / Setup Flatpak Matrix (push) Waiting to run
CI / Linux Flatpak (push) Blocked by required conditions
CI / Linux ${{ matrix.type }} (--appimage-build, 22.04, AppImage) (push) Blocked by required conditions
CI / Homebrew (${{ matrix.os_name }}-${{ matrix.os_version }}${{ matrix.release == true && ' (Release)' || '' }}) (macos, 12) (push) Blocked by required conditions
CI / Homebrew (${{ matrix.os_name }}-${{ matrix.os_version }}${{ matrix.release == true && ' (Release)' || '' }}) (macos, 13) (push) Blocked by required conditions
CI / Homebrew (${{ matrix.os_name }}-${{ matrix.os_version }}${{ matrix.release == true && ' (Release)' || '' }}) (macos, 14) (push) Blocked by required conditions
CI / Homebrew (${{ matrix.os_name }}-${{ matrix.os_version }}${{ matrix.release == true && ' (Release)' || '' }}) (ubuntu, latest) (push) Blocked by required conditions
CI / Homebrew (${{ matrix.os_name }}-${{ matrix.os_version }}${{ matrix.release == true && ' (Release)' || '' }}) (ubuntu, latest, true) (push) Blocked by required conditions
CI / Macports (macOS-${{ matrix.os_version }}) (12, true) (push) Blocked by required conditions
CI / Macports (macOS-${{ matrix.os_version }}) (13) (push) Blocked by required conditions
CI / Macports (macOS-${{ matrix.os_version }}) (14) (push) Blocked by required conditions
CI / Windows (push) Blocked by required conditions
CI Docker / Check Dockerfiles (push) Waiting to run
CI Docker / Setup Release (push) Blocked by required conditions
CI Docker / Lint Dockerfile${{ matrix.tag }} (push) Blocked by required conditions
CI Docker / Docker${{ matrix.tag }} (push) Blocked by required conditions
CodeQL / Get language matrix (push) Waiting to run
CodeQL / Analyze (${{ matrix.name }}) (push) Blocked by required conditions
Build GH-Pages / update_pages (push) Waiting to run
localize / Update Localization (push) Has been cancelled
feat(tests): rework tests in numerous ways (#3059)
2024-08-22 16:48:24 -04:00

37 lines
877 B
C++

/**
* @file tests/unit/test_rswrapper.cpp
* @brief Test src/rswrapper.*
*/
extern "C" {
#include <src/rswrapper.h>
}
#include "../tests_common.h"
TEST(ReedSolomonWrapperTests, InitTest) {
reed_solomon_init();
// Ensure all function pointers were populated
ASSERT_NE(reed_solomon_new, nullptr);
ASSERT_NE(reed_solomon_release, nullptr);
ASSERT_NE(reed_solomon_encode, nullptr);
ASSERT_NE(reed_solomon_decode, nullptr);
}
TEST(ReedSolomonWrapperTests, EncodeTest) {
reed_solomon_init();
auto rs = reed_solomon_new(1, 1);
ASSERT_NE(rs, nullptr);
uint8_t dataShard[16] = {};
uint8_t fecShard[16] = {};
// If we picked the incorrect ISA in our wrapper, we should crash here
uint8_t *shardPtrs[2] = { dataShard, fecShard };
auto ret = reed_solomon_encode(rs, shardPtrs, 2, sizeof(dataShard));
ASSERT_EQ(ret, 0);
reed_solomon_release(rs);
}