[ox] Make OC and Claw writers take const values
This commit is contained in:
9
deps/ox/src/ox/mc/test/tests.cpp
vendored
9
deps/ox/src/ox/mc/test/tests.cpp
vendored
@ -113,7 +113,8 @@ std::map<ox::String, ox::Error(*)()> tests = {
|
||||
static constexpr size_t buffLen = 1024;
|
||||
char buff[buffLen];
|
||||
TestStruct ts;
|
||||
oxReturnError(ox::writeMC(buff, buffLen, &ts));
|
||||
oxReturnError(ox::writeMC(buff, buffLen, ts));
|
||||
oxReturnError(ox::writeMC(ts));
|
||||
return OxError(0);
|
||||
}
|
||||
},
|
||||
@ -138,7 +139,7 @@ std::map<ox::String, ox::Error(*)()> tests = {
|
||||
testIn.Struct.Int = 300;
|
||||
testIn.Struct.BString = "Test String 2";
|
||||
// run tests
|
||||
const auto [buff, err] = ox::writeMC(&testIn);
|
||||
const auto [buff, err] = ox::writeMC(testIn);
|
||||
oxAssert(err, "writeMC failed");
|
||||
oxAssert(ox::readMC(buff.data(), buff.size(), &testOut), "readMC failed");
|
||||
//std::cout << testIn.Union.Int << "|" << testOut.Union.Int << "|\n";
|
||||
@ -306,7 +307,7 @@ std::map<ox::String, ox::Error(*)()> tests = {
|
||||
testIn.Struct.BString = "Test String 2";
|
||||
testIn.unionIdx = 1;
|
||||
testIn.Union.Int = 93;
|
||||
oxAssert(ox::writeMC(dataBuff.data(), dataBuff.size(), &testIn), "Data generation failed");
|
||||
oxAssert(ox::writeMC(dataBuff.data(), dataBuff.size(), testIn), "Data generation failed");
|
||||
ox::TypeStore typeStore;
|
||||
const auto [type, typeErr] = ox::buildTypeDef(&typeStore, &testIn);
|
||||
oxAssert(typeErr, "Descriptor write failed");
|
||||
@ -358,7 +359,7 @@ std::map<ox::String, ox::Error(*)()> tests = {
|
||||
testIn.Struct.Bool = false;
|
||||
testIn.Struct.Int = 300;
|
||||
testIn.Struct.BString = "Test String 2";
|
||||
oxAssert(ox::writeMC(dataBuff, dataBuffLen, &testIn), "Data generation failed");
|
||||
oxAssert(ox::writeMC(dataBuff, dataBuffLen, testIn), "Data generation failed");
|
||||
ox::TypeStore typeStore;
|
||||
const auto [type, typeErr] = ox::buildTypeDef(&typeStore, &testIn);
|
||||
oxAssert(typeErr, "Descriptor write failed");
|
||||
|
Reference in New Issue
Block a user