summaryrefslogtreecommitdiffstats
path: root/examples/new.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/new.c')
-rw-r--r--examples/new.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/examples/new.c b/examples/new.c
index db46927c28c..8d0adb5bee1 100644
--- a/examples/new.c
+++ b/examples/new.c
@@ -130,12 +130,24 @@ test_ncr_data(int cfd)
if (ioctl(cfd, NCRIO_DATA_GET, &kdata)) {
perror("ioctl");
fprintf(stderr, "Verified that unexportable data cannot be exported\n");
- return 0;
+ } else {
+ fprintf(stderr, "Unexportable data were exported!?\n");
+ return 1; /* ok */
}
- fprintf(stderr, "Unexportable data were exported!?\n");
-
- return 1; /* ok */
+ for (i=0;i<512;i++ ) {
+ init.max_object_size = DATA_SIZE;
+ init.flags = 0;
+ init.initial_data = data;
+ init.initial_data_size = sizeof(data);
+
+ if (ioctl(cfd, NCRIO_DATA_INIT, &init)) {
+ perror("ioctl(NCRIO_DATA_INIT)");
+ fprintf(stderr, "Reached maximum limit at: %d data\n", i);
+ }
+ }
+
+ return 0;
}
int