Stabilize Conan build and remove stale TLS code
Simplifies the active Windows build path around Boost.Beast/OpenSSL, fixes VS2017/clang-cl compatibility, and removes unused BearSSL/WinHTTP remnants so the project builds and tests cleanly. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -27,7 +27,8 @@ int main()
|
||||
}
|
||||
|
||||
const auto file_path = dir / "sample.txt";
|
||||
if (dstalk_file_write(file_path.string().c_str(), "hello dstalk") != 0) {
|
||||
constexpr const char* sample_content = "hello dstalk\nquote=\"yes\" tab=\t slash=\\";
|
||||
if (dstalk_file_write(file_path.string().c_str(), sample_content) != 0) {
|
||||
std::cerr << "dstalk_file_write failed\n";
|
||||
dstalk_destroy();
|
||||
return 1;
|
||||
@@ -40,12 +41,47 @@ int main()
|
||||
return 1;
|
||||
}
|
||||
|
||||
const bool ok = std::strcmp(content, "hello dstalk") == 0;
|
||||
const bool ok = std::strcmp(content, sample_content) == 0;
|
||||
dstalk_free_string(content);
|
||||
dstalk_destroy();
|
||||
|
||||
if (!ok) {
|
||||
std::cerr << "unexpected file content\n";
|
||||
dstalk_destroy();
|
||||
return 1;
|
||||
}
|
||||
|
||||
const auto session_path = dir / "session.jsonl";
|
||||
const auto saved_session_path = dir / "session-saved.jsonl";
|
||||
constexpr const char* session_content =
|
||||
"{\"role\":\"user\",\"content\":\"line\\n\\\"quote\\\"\\\\slash\"}\n"
|
||||
"{\"role\":\"assistant\",\"content\":\"ok\\tready\"}\n";
|
||||
if (dstalk_file_write(session_path.string().c_str(), session_content) != 0) {
|
||||
std::cerr << "session fixture write failed\n";
|
||||
dstalk_destroy();
|
||||
return 1;
|
||||
}
|
||||
if (dstalk_session_load(session_path.string().c_str()) != 0) {
|
||||
std::cerr << "dstalk_session_load failed\n";
|
||||
dstalk_destroy();
|
||||
return 1;
|
||||
}
|
||||
if (dstalk_session_save(saved_session_path.string().c_str()) != 0) {
|
||||
std::cerr << "dstalk_session_save failed\n";
|
||||
dstalk_destroy();
|
||||
return 1;
|
||||
}
|
||||
|
||||
char* saved_session = nullptr;
|
||||
if (dstalk_file_read(saved_session_path.string().c_str(), &saved_session) != 0 || !saved_session) {
|
||||
std::cerr << "saved session read failed\n";
|
||||
dstalk_destroy();
|
||||
return 1;
|
||||
}
|
||||
const bool session_ok = std::strcmp(saved_session, session_content) == 0;
|
||||
dstalk_free_string(saved_session);
|
||||
dstalk_destroy();
|
||||
|
||||
if (!session_ok) {
|
||||
std::cerr << "unexpected saved session content\n";
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user