rename test programs
This commit is contained in:
parent
ded5ad858b
commit
0134274aec
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,2 +1,4 @@
|
||||
build/
|
||||
.cache/
|
||||
test_with_args
|
||||
test_access
|
||||
|
||||
@ -1,61 +0,0 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
// Global variables for testing
|
||||
volatile int global_int = 0;
|
||||
volatile long global_long = 1000L;
|
||||
volatile unsigned int global_uint = 0U;
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
printf("=== Sample Program for gwatch ===\n");
|
||||
|
||||
// Test 1: Simple write
|
||||
printf("Test 1: Simple write\n");
|
||||
global_int = 42;
|
||||
printf(" global_int = %d\n", global_int);
|
||||
|
||||
// Test 2: Multiple writes
|
||||
printf("Test 2: Multiple writes\n");
|
||||
global_int = 100;
|
||||
printf(" global_int = %d\n", global_int);
|
||||
global_int = 200;
|
||||
printf(" global_int = %d\n", global_int);
|
||||
|
||||
// Test 3: Increment operation
|
||||
printf("Test 3: Increment\n");
|
||||
global_int++;
|
||||
printf(" global_int = %d\n", global_int);
|
||||
|
||||
// Test 4: Arithmetic
|
||||
printf("Test 4: Arithmetic\n");
|
||||
global_int = global_int + 50;
|
||||
printf(" global_int = %d\n", global_int);
|
||||
|
||||
// Test 5: Read operation (shouldn't show write)
|
||||
printf("Test 5: Read operation\n");
|
||||
int temp = global_int;
|
||||
printf(" Read value: %d\n", temp);
|
||||
|
||||
// Test 6: Long variable operations
|
||||
printf("Test 6: Long variable\n");
|
||||
global_long = 5000L;
|
||||
printf(" global_long = %ld\n", global_long);
|
||||
global_long += 2500L;
|
||||
printf(" global_long = %ld\n", global_long);
|
||||
|
||||
// Test 7: Unsigned int operations
|
||||
printf("Test 7: Unsigned int\n");
|
||||
global_uint = 999U;
|
||||
printf(" global_uint = %u\n", global_uint);
|
||||
|
||||
// Test 8: Command-line argument handling
|
||||
if (argc > 1) {
|
||||
printf("Test 8: With command-line args\n");
|
||||
int arg_val = atoi(argv[1]);
|
||||
global_int = arg_val;
|
||||
printf(" global_int = %d (from arg)\n", global_int);
|
||||
}
|
||||
|
||||
printf("=== Program Complete ===\n");
|
||||
return 0;
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user