#include <stdio.h>
#include <unistd.h>
#include <time.h>
#include <stdlib.h>
#include "sample_lib.h"
void test_function(int value) {
}
int calculate_something(int a, int b) {
int result = a * b + 42;
return result;
}
void process_data(const char* message) {
printf("Processing: %s\n", message);
}
int main() {
printf("Starting test program...\n");
init_test_lib();
int counter = 0;
time_t start_time = time(NULL);
int numbers[] = {10, 20, 30, 40, 50};
DataRecord record = {1, "test_record", 100.0};
while (counter < 20000) { counter++;
test_function(counter);
int result = calculate_something(counter, counter + 5);
if (result % 7 == 0) {
++record.value;
}
int sum = add_numbers(counter, counter * 2);
int product = multiply_numbers(counter, 3);
char message[256];
format_message(message, sizeof(message), "Iteration", counter);
int msg_len = get_string_length(message);
process_record(&record);
if (counter % 5 == 0) {
print_record(&record);
}
log_activity("main_loop", counter % 3 + 1);
int random_val = get_random_value(1, 100);
if (counter % 10 == 0) {
double avg = calculate_average(numbers, 5);
}
sink_void(numbers);
sleep(2); }
cleanup_test_lib();
time_t end_time = time(NULL);
printf("\nTest program finished after %ld seconds, %d iterations\n",
end_time - start_time, counter);
return 0;
}