Compare commits

..

No commits in common. "d3a2124f8b65a82e61b4574665872d0ef94b8bb5" and "4c37f4872d709a04c5b5d0cc7aa342eae26c8643" have entirely different histories.

26 changed files with 0 additions and 175 deletions

View file

@ -10,20 +10,6 @@
#include <stdbool.h>
/**
* @brief Indique si une transaction est actuellement active.
*
* Cette fonction ne modifie ni la connexion ni son erreur courante.
*
* @param database Connexion à inspecter.
*
* @return true lorsquune transaction est active, sinon false.
* Une connexion NULL retourne false.
*/
bool database_transaction_is_active(
const Database *database
);
/**
* @brief Démarre une transaction d'écriture immédiate.
*

BIN
labfy-investigation Executable file

Binary file not shown.

View file

@ -88,20 +88,6 @@ static bool database_transaction_execute(
return true;
}
bool database_transaction_is_active(
const Database *database
)
{
if (database == NULL)
{
return false;
}
return database_get_transaction_active(
database
);
}
bool database_transaction_begin(
Database *database
)

BIN
tests/test_background_task Executable file

Binary file not shown.

BIN
tests/test_database Executable file

Binary file not shown.

BIN
tests/test_error Executable file

Binary file not shown.

BIN
tests/test_evidence_copy Executable file

Binary file not shown.

BIN
tests/test_evidence_dao Executable file

Binary file not shown.

BIN
tests/test_evidence_record Executable file

Binary file not shown.

BIN
tests/test_file_hash Executable file

Binary file not shown.

BIN
tests/test_investigation_dao Executable file

Binary file not shown.

BIN
tests/test_investigation_node Executable file

Binary file not shown.

BIN
tests/test_investigation_project Executable file

Binary file not shown.

BIN
tests/test_investigation_record Executable file

Binary file not shown.

BIN
tests/test_investigation_session Executable file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
tests/test_statement Executable file

Binary file not shown.

BIN
tests/test_task_manager Executable file

Binary file not shown.

BIN
tests/test_tool_catalog Executable file

Binary file not shown.

BIN
tests/test_tool_initializer Executable file

Binary file not shown.

BIN
tests/test_tool_process Executable file

Binary file not shown.

BIN
tests/test_tool_registry Executable file

Binary file not shown.

BIN
tests/test_tool_task Executable file

Binary file not shown.

BIN
tests/test_transaction Executable file

Binary file not shown.

View file

@ -10,7 +10,6 @@
#include <assert.h>
#include <stdio.h>
#include <string.h>
/**
* @brief Crée la table utilisée par les tests.
@ -307,158 +306,12 @@ static void test_transaction_error_state(void)
database_close(database);
}
/**
* @brief Vérifie lexposition publique de létat de transaction.
*/
static void test_transaction_active_state(void)
{
Database *database = NULL;
const char *error_message = NULL;
database =
database_open(
":memory:"
);
assert(database != NULL);
/*
* Une connexion nouvelle ne possède aucune transaction active.
*/
assert(
!database_transaction_is_active(
database
)
);
/*
* Une connexion NULL est considérée comme inactive.
*/
assert(
!database_transaction_is_active(
NULL
)
);
/*
* La consultation de létat ne doit pas modifier lerreur courante.
*/
database_error_set(
database,
DATABASE_ERROR_INVALID_ARGUMENT,
"erreur témoin"
);
assert(
!database_transaction_is_active(
database
)
);
assert(
database_error_get_code(
database
) ==
DATABASE_ERROR_INVALID_ARGUMENT
);
error_message =
database_error_get_message(
database
);
assert(error_message != NULL);
assert(
strcmp(
error_message,
"erreur témoin"
) == 0
);
database_error_clear(
database
);
/*
* Létat devient actif après BEGIN.
*/
assert(
database_transaction_begin(
database
)
);
assert(
database_transaction_is_active(
database
)
);
/*
* Un simple contrôle ne doit pas terminer la transaction.
*/
assert(
database_transaction_is_active(
database
)
);
/*
* Létat redevient inactif après COMMIT.
*/
assert(
database_transaction_commit(
database
)
);
assert(
!database_transaction_is_active(
database
)
);
/*
* Même vérification avec un ROLLBACK.
*/
assert(
database_transaction_begin(
database
)
);
assert(
database_transaction_is_active(
database
)
);
assert(
database_transaction_rollback(
database
)
);
assert(
!database_transaction_is_active(
database
)
);
database_close(
database
);
}
int main(void)
{
test_transaction_commit();
test_transaction_rollback();
test_invalid_transaction_states();
test_transaction_error_state();
test_transaction_active_state();
printf(
"DatabaseTransaction : tous les tests sont valides.\n"