Advertisement
Guest User

Untitled

a guest
Feb 11th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. #include <Eina.h>
  2. #include <stdlib.h>
  3. #include <stdio.h>
  4. #include <string.h>
  5. #include <assert.h>
  6.  
  7. int main(int argc, char const *argv[])
  8. {
  9. Eina_Value *value;
  10. Eina_Value_Blob in, out;
  11. unsigned char blob[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
  12.  
  13. eina_init();
  14.  
  15. value = eina_value_new(EINA_VALUE_TYPE_BLOB);
  16.  
  17. in.ops = NULL;
  18. in.memory = blob;
  19. in.size = sizeof(blob);
  20. assert(eina_value_set(value, in));
  21. assert(eina_value_get(value, &out));
  22. assert(out.ops == in.ops);
  23. assert(out.size == in.size);
  24. assert(out.memory == in.memory);
  25. assert(memcmp(&in, &out, sizeof(Eina_Value_Blob)) == 0);
  26.  
  27. eina_value_free(value);
  28.  
  29. eina_shutdown();
  30. return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement