summaryrefslogtreecommitdiff
path: root/test/endless/test-hello.c
diff options
context:
space:
mode:
authorJuan Pablo Ugarte <juanpablougarte@gmail.com>2018-06-12 16:20:58 -0300
committerGitHub <noreply@github.com>2018-06-12 16:20:58 -0300
commit2110eb3bf6a60440bacfcfffde50b1fcaa4e7eef (patch)
tree0dba6399db901b5800e4651baa679e81416d32d7 /test/endless/test-hello.c
parent7e456e2a5534aa2617465b98ae551b8d26e7bf58 (diff)
parent23531cce8a9027f4df6376a4e26450c237352579 (diff)
Merge pull request #4184 from endlessm/T22827
Fix broken tests
Diffstat (limited to 'test/endless/test-hello.c')
-rw-r--r--test/endless/test-hello.c59
1 files changed, 0 insertions, 59 deletions
diff --git a/test/endless/test-hello.c b/test/endless/test-hello.c
deleted file mode 100644
index 687f14d..0000000
--- a/test/endless/test-hello.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/* Copyright 2013 Endless Mobile, Inc. */
-
-#include <stdlib.h>
-#include <glib.h>
-#include <endless/endless.h>
-
-#include "run-tests.h"
-
-#define EXPECTED_HELLO_STRING "Hello, world!\n"
-
-static void
-test_hello_stdout (void)
-{
- GError *error = NULL;
-
- /* Unix-only test */
- if (g_test_trap_fork(0 /* timeout */, G_TEST_TRAP_SILENCE_STDOUT))
- {
- gboolean success = eos_hello_sample_function (NULL, &error);
- g_assert (success);
- g_assert_no_error (error);
- exit (0);
- }
-
- g_test_trap_assert_passed ();
- g_test_trap_assert_stdout (EXPECTED_HELLO_STRING);
-}
-
-static void
-test_hello_gfile (void)
-{
- GError *error = NULL;
- GFileIOStream *stream;
- GFile *file = g_file_new_tmp ("sdktestXXXXXX", &stream, &error);
- gboolean success;
- char *file_contents;
-
- g_assert_no_error (error);
- g_io_stream_close (G_IO_STREAM (stream), NULL, &error);
- g_assert_no_error (error);
-
- success = eos_hello_sample_function (file, &error);
- g_assert (success);
- g_assert_no_error (error);
-
- g_file_load_contents (file, NULL, &file_contents, NULL, NULL, &error);
- g_assert_no_error (error);
- g_assert_cmpstr (file_contents, ==, EXPECTED_HELLO_STRING);
-
- g_free (file_contents);
- g_object_unref (file);
-}
-
-void
-add_hello_tests (void)
-{
- g_test_add_func ("/hello/stdout", test_hello_stdout);
- g_test_add_func ("/hello/gfile", test_hello_gfile);
-}