883 files, from working commit b1a079a. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
26 lines
1.5 KiB
C++
26 lines
1.5 KiB
C++
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
#include "gateway/quest_poi_response.hpp"
|
|
#include <iostream>
|
|
using namespace gateway;
|
|
static void check(bool b){if(!b)throw Error("quest POI response fixture failed");}
|
|
template<class F> static void rejects(F f){try{f();}catch(const Error&){return;}throw Error("expected POI rejection");}
|
|
int main(){
|
|
// Independent wire vector from the pinned SDK writer: two count words,
|
|
// quest and blob count, twelve scalar words, point count, signed XYZ16,
|
|
// and one MSB-first merge bit. It is not a native-client acceptance proof.
|
|
QuestPoiRecord q;q.quest=60141;q.blobs.resize(1);auto& b=q.blobs[0];
|
|
b.fields={1,-1,123,456,0,1429,7,8,9,10,11,12};
|
|
b.points={{-123,456,0},{32767,-32768,23}};b.merge=true;
|
|
auto expected=unhex("0100000001000000edea000001000000"
|
|
"01000000ffffffff7b000000c80100000000000095050000"
|
|
"0700000008000000090000000a0000000b0000000c000000"
|
|
"0200000085ffc8010000ff7f0080170080");
|
|
check(serialize_quest_poi_response(std::span(&q,1))==expected);
|
|
check(serialize_quest_poi_response({})==unhex("0000000000000000"));
|
|
b.points[0].x=32768;rejects([&]{serialize_quest_poi_response(std::span(&q,1));});
|
|
b.points[0].x=-32769;rejects([&]{serialize_quest_poi_response(std::span(&q,1));});
|
|
std::vector<QuestPoiRecord> many(176);rejects([&]{serialize_quest_poi_response(many);});
|
|
q.blobs.resize(129);rejects([&]{serialize_quest_poi_response(std::span(&q,1));});
|
|
std::cout<<"Pinned quest POI response writer format and bounds checked; no client delivery.\n";
|
|
}
|