b9874d0941
Add redbear-usb-storage-check in-guest binary that validates USB mass storage read and write I/O: discovers /scheme/disk/ devices, writes a test pattern to sector 2048, reads it back, verifies match, restores original content. Updates test-usb-storage-qemu.sh with write-proof verification step. Includes all accumulated Red Bear OS work: kernel patches, relibc patches, driver infrastructure, DRM/GPU, KDE recipes, firmware, validation tooling, build system hardening, and documentation.
27 lines
571 B
C
27 lines
571 B
C
#include <string.h>
|
|
#include <assert.h>
|
|
|
|
void test_stpcpy(const char *src, char *dest) {
|
|
char *end = stpcpy(dest, src);
|
|
assert(strcmp(dest, src) == 0);
|
|
assert(*end == '\0');
|
|
assert(end == dest + strlen(dest));
|
|
}
|
|
|
|
int main() {
|
|
char dest[20];
|
|
|
|
test_stpcpy("Hello, World!", dest);
|
|
|
|
// Test case 2: Empty string
|
|
test_stpcpy("", dest);
|
|
|
|
// Test case 3: String with special characters
|
|
test_stpcpy("Special chars: !@#$%^&*()", dest);
|
|
|
|
// Test case 4: String with spaces
|
|
test_stpcpy("A string with spaces", dest);
|
|
|
|
return 0;
|
|
}
|