Initial commit

This commit is contained in:
github-classroom[bot] 2025-04-28 22:11:20 +00:00 committed by GitHub
commit b4c0b22597
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
104 changed files with 10100 additions and 0 deletions

40
test_sorting_criteria.c Normal file
View file

@ -0,0 +1,40 @@
/*----------------------------------------------------------
* HTBLA-Leonding / Klasse: n/a
* ---------------------------------------------------------
* Title: Unit Tests for sorting criteria implementation
* Author: S. Schraml
* ----------------------------------------------------------
* Description:
* Tests functions for sorting criteria.
* ----------------------------------------------------------
*/
#include "test_sorting_criteria.h"
#include <stdio.h>
#include "shortcut.h"
#include "config.h"
#include "sorting_criteria.h"
/* ------------------------------------------------------------------- */
TEST(test_is_in_asc_order__shall_be_true_for_ascending_params) {
ASSERT_TRUE(is_in_asc_order(1, 2), MSG("Expected true for ascending values"));
}
TEST(test_is_in_asc_order__shall_be_true_for_equal_params) {
ASSERT_TRUE(is_in_asc_order(3, 3), MSG("Expected true for equal values"));
}
TEST(test_is_in_asc_order__shall_be_false_for_descending_params) {
ASSERT_FALSE(is_in_asc_order(5, 4), MSG("Expected false for descending values"));
}
TEST(test_is_in_desc_order__shall_be_false_for_ascending_params) {
ASSERT_FALSE(is_in_desc_order(11, 12), MSG("Expected false for ascending values"));
}
TEST(test_is_in_desc_order__shall_be_true_for_equal_params) {
ASSERT_TRUE(is_in_desc_order(13, 13), MSG("Expected true for ascending values"));
}
TEST(test_is_in_desc_order__shall_be_true_for_descending_params) {
ASSERT_TRUE(is_in_desc_order(15, 14), MSG("Expected true for descending values"));
}