PageRenderTime 20ms CodeModel.GetById 16ms RepoModel.GetById 1ms app.codeStats 0ms

/js/lib/Socket.IO-node/support/expresso/deps/jscoverage/tests/json.c

http://github.com/onedayitwillmake/RealtimeMultiplayerNodeJs
C | 48 lines | 21 code | 9 blank | 18 comment | 1 complexity | 593abe5696fb2f6e07c8b83a864060e4 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.1, MPL-2.0-no-copyleft-exception, BSD-3-Clause
  1. /*
  2. json.c - test JSON manipulation
  3. Copyright (C) 2008 siliconforks.com
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License along
  13. with this program; if not, write to the Free Software Foundation, Inc.,
  14. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  15. */
  16. #include <assert.h>
  17. #include <stdlib.h>
  18. #include <string.h>
  19. #include "instrument-js.h"
  20. #include "stream.h"
  21. #include "util.h"
  22. bool jscoverage_highlight = true;
  23. int main(void) {
  24. jscoverage_init();
  25. Stream * stream = Stream_new(0);
  26. FILE * f = xfopen("store.json", "r");
  27. Stream_write_file_contents(stream, f);
  28. fclose(f);
  29. Coverage * coverage = Coverage_new();
  30. int result = jscoverage_parse_json(coverage, stream->data, stream->length);
  31. assert(result == 0);
  32. Coverage_delete(coverage);
  33. Stream_delete(stream);
  34. jscoverage_cleanup();
  35. exit(EXIT_SUCCESS);
  36. }