test_disk.c 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /******************************************************************************
  2. This program is free software; you can redistribute it and/or modify
  3. it under the terms of the GNU General Public License as published by
  4. the Free Software Foundation; either version 2 of the License, or
  5. (at your option) any later version.
  6. This program is distributed in the hope that it will be useful,
  7. but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  9. GNU General Public License for more details.
  10. You should have received a copy of the GNU General Public License
  11. along with this program; if not, write to the Free Software
  12. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  13. $Id$
  14. ******************************************************************************/
  15. #include "common.h"
  16. #include "utils_disk.h"
  17. #include "tap.h"
  18. int
  19. main (int argc, char **argv)
  20. {
  21. struct name_list *exclude_filesystem=NULL;
  22. struct name_list *exclude_fstype=NULL;
  23. plan_tests(8);
  24. ok( np_find_name(exclude_filesystem, "/var") == FALSE, "/var not in list");
  25. np_add_name(&exclude_filesystem, "/var");
  26. ok( np_find_name(exclude_filesystem, "/var") == TRUE, "is in list now");
  27. ok( np_find_name(exclude_filesystem, "/home") == FALSE, "/home not in list");
  28. np_add_name(&exclude_filesystem, "/home");
  29. ok( np_find_name(exclude_filesystem, "/home") == TRUE, "is in list now");
  30. ok( np_find_name(exclude_filesystem, "/var") == TRUE, "/var still in list");
  31. ok( np_find_name(exclude_fstype, "iso9660") == FALSE, "iso9660 not in list");
  32. np_add_name(&exclude_fstype, "iso9660");
  33. ok( np_find_name(exclude_fstype, "iso9660") == TRUE, "is in list now");
  34. ok( np_find_name(exclude_filesystem, "iso9660") == FALSE, "Make sure no clashing in variables");
  35. /*
  36. range = parse_range_string("6");
  37. ok( range != NULL, "'6' is valid range");
  38. ok( range->start == 0, "Start correct");
  39. ok( range->start_infinity == FALSE, "Not using negative infinity");
  40. ok( range->end == 6, "End correct");
  41. ok( range->end_infinity == FALSE, "Not using infinity");
  42. free(range);
  43. range = parse_range_string("-7:23");
  44. ok( range != NULL, "'-7:23' is valid range");
  45. ok( range->start == -7, "Start correct");
  46. ok( range->start_infinity == FALSE, "Not using negative infinity");
  47. ok( range->end == 23, "End correct");
  48. ok( range->end_infinity == FALSE, "Not using infinity");
  49. free(range);
  50. range = parse_range_string(":5.75");
  51. ok( range != NULL, "':5.75' is valid range");
  52. ok( range->start == 0, "Start correct");
  53. ok( range->start_infinity == FALSE, "Not using negative infinity");
  54. ok( range->end == 5.75, "End correct");
  55. ok( range->end_infinity == FALSE, "Not using infinity");
  56. free(range);
  57. range = parse_range_string("~:-95.99");
  58. ok( range != NULL, "~:-95.99' is valid range");
  59. ok( range->start_infinity == TRUE, "Using negative infinity");
  60. ok( range->end == -95.99, "End correct (with rounding errors)");
  61. ok( range->end_infinity == FALSE, "Not using infinity");
  62. free(range);
  63. */
  64. return exit_status();
  65. }