Files
cproof/tests/unittests/database/stub_database.c
jabber.developer2 508de43da9
Some checks failed
CI Code / Check spelling (pull_request) Successful in 17s
CI Code / Check coding style (pull_request) Successful in 31s
CI Code / Linux (debian) (pull_request) Failing after 39s
CI Code / Linux (ubuntu) (pull_request) Failing after 42s
CI Code / Linux (arch) (pull_request) Failing after 4m59s
CI Code / Code Coverage (pull_request) Failing after 4m48s
Merge branch 'master' into merge/upstream-full
Resolve conflicts after master gained the flat-file database backend,
AI client, and other cproof-fork features:

- CHANGELOG: keep cproof-fork unreleased section atop full upstream
  history (0.17.0 / 0.16.0 / 0.15.1)
- src/command/cmd_ac.c: keep both upstream spellcheck AC and cproof
  /history switch|verify|export|import autocompletion
- src/config/preferences.c: merge upstream [spellcheck] group with the
  cproof [ai]/[ai/<provider>] groups
- src/database.c: take master (thin dispatcher); upstream SQLite
  improvements (v3 migration, auto_gchar) belong in database_sqlite.c
  and will land in a follow-up commit
- src/tools/autocomplete.c: take upstream unescape of search_str
- src/ui/statusbar.c: keep guint signatures (per project preference)
  and adapt _status_bar_draw_dbbackend to guint as well
- src/xmpp/jid.c: combine the new jid_is_valid/jid_is_valid_user_jid
  with the "(null)" legacy-placeholder guard in
  jid_create_from_bare_and_resource; use auto_gchar
- tests/functionaltests/proftest.c: keep unsigned-safe pre-check on
  output_len before subtracting OUTPUT_BUF_SIZE
- tests/unittests/unittests.c: keep upstream subdirectory include
  layout plus cproof-only test_ai_client/database_export/database_stress
- tests/unittests/test_jid.c: drop orphan top-level copy (the
  restructured version lives in tests/unittests/xmpp/test_jid.c)

Upstream is included up to 1ac05754b (release 0.18.0 era). Follow-up:
pull 1ac05754b..upstream/master (esp. 42a849d16 db migration fix and
4749645c7 receipt-request restore), and adapt the SQLite improvements
into database_sqlite.c.
2026-05-18 11:42:48 +03:00

110 lines
2.0 KiB
C

/*
* stub_database.c
*
* Copyright (C) 2020 - 2026 Michael Vetter <jubalh@iodoru.org>
*
* SPDX-License-Identifier: GPL-3.0-or-later WITH OpenSSL-exception
*/
#include <glib.h>
#include "prof_cmocka.h"
#include "config.h"
#include "database.h"
#include "database_flatfile.h"
db_backend_t* active_db_backend = NULL;
// The flatfile parser needs this global for path construction.
// In tests we keep it NULL since no real file I/O happens via the backend.
char* g_flatfile_account_jid = NULL;
gboolean
log_database_init(ProfAccount* account)
{
return TRUE;
}
void
log_database_add_incoming(ProfMessage* message)
{
}
void
log_database_add_outgoing_chat(const char* const id, const char* const barejid, const char* const message, const char* const replace_id, prof_enc_t enc)
{
}
void
log_database_add_outgoing_muc(const char* const id, const char* const barejid, const char* const message, const char* const replace_id, prof_enc_t enc)
{
}
void
log_database_add_outgoing_muc_pm(const char* const id, const char* const barejid, const char* const message, const char* const replace_id, prof_enc_t enc)
{
}
void
log_database_close(void)
{
}
gboolean
log_database_switch_backend(const char* new_backend)
{
return TRUE;
}
GSList*
log_database_verify_integrity(const gchar* const contact_barejid)
{
return NULL;
}
void
integrity_issue_free(integrity_issue_t* issue)
{
if (issue) {
g_free(issue->file);
g_free(issue->message);
g_free(issue);
}
}
#ifdef HAVE_SQLITE
db_backend_t*
db_backend_sqlite(void)
{
return NULL;
}
GSList*
db_sqlite_list_contacts(void)
{
return NULL;
}
GSList*
db_sqlite_get_all_chat(const gchar* const contact_barejid)
{
return NULL;
}
void
db_sqlite_begin_transaction(void)
{
}
void
db_sqlite_end_transaction(void)
{
}
void
db_sqlite_rollback_transaction(void)
{
}
int
log_database_export_to_flatfile(const gchar* const contact_jid)
{
return 0;
}
int
log_database_import_from_flatfile(const gchar* const contact_jid)
{
return 0;
}
#endif
db_backend_t*
db_backend_flatfile(void)
{
return NULL;
}