[ox] Make ox::String::String(const char*) explicit

This commit is contained in:
2023-12-01 22:36:24 -06:00
parent e9822bf124
commit 1a1c8ae6cc
13 changed files with 83 additions and 105 deletions

View File

@ -45,7 +45,7 @@ struct TestStruct {
int32_t Int8 = 0;
int unionIdx = 1;
TestUnion Union;
ox::String String = "";
ox::String String;
ox::BString<32> BString = "";
uint32_t List[4] = {0, 0, 0, 0};
ox::Vector<uint32_t> Vector = {1, 2, 3, 4, 5};
@ -108,7 +108,7 @@ constexpr ox::Error model(T *io, ox::CommonPtrWith<TestStruct> auto *obj) noexce
std::map<ox::String, ox::Error(*)()> tests = {
{
{
"MetalClawWriter",
ox::String("MetalClawWriter"),
[] {
// This test doesn't confirm much, but it does show that the writer
// doesn't segfault
@ -121,7 +121,7 @@ std::map<ox::String, ox::Error(*)()> tests = {
},
{
"MetalClawReader",
ox::String("MetalClawReader"),
[] {
// setup for tests
TestStruct testIn, testOut;
@ -180,7 +180,7 @@ std::map<ox::String, ox::Error(*)()> tests = {
},
{
"encodeInteger",
ox::String("encodeInteger"),
[] {
using ox::MaxValue;
using ox::mc::McInt;
@ -251,7 +251,7 @@ std::map<ox::String, ox::Error(*)()> tests = {
},
{
"decodeInteger",
ox::String("decodeInteger"),
[] {
using ox::MaxValue;
using ox::mc::McInt;
@ -293,7 +293,7 @@ std::map<ox::String, ox::Error(*)()> tests = {
{
"MetalClawModelValue",
ox::String("MetalClawModelValue"),
[] {
static constexpr size_t dataBuffLen = ox::units::MB;
ox::Buffer dataBuff(dataBuffLen);
@ -345,7 +345,7 @@ std::map<ox::String, ox::Error(*)()> tests = {
},
{
"MetalClawDef",
ox::String("MetalClawDef"),
[] {
//constexpr size_t descBuffLen = 1024;
//uint8_t descBuff[descBuffLen];
@ -461,7 +461,7 @@ std::map<ox::String, ox::Error(*)()> tests = {
int main(int argc, const char **args) {
if (argc > 0) {
auto testName = args[1];
auto testName = ox::String(args[1]);
if (tests.find(testName) != tests.end()) {
oxAssert(tests[testName](), "Test failed...");
}