Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Unified Diff: tests/nameservice/nameservice_test.c

Issue 891603002: Removes the name service from the service runtime (Closed) Base URL: https://chromium.googlesource.com/native_client/src/native_client.git@master
Patch Set: Fixes code review comments Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/nameservice/nacl.scons ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/nameservice/nameservice_test.c
diff --git a/tests/nameservice/nameservice_test.c b/tests/nameservice/nameservice_test.c
deleted file mode 100644
index f95b730d205e678cafe8acb243356b59c8bd2aba..0000000000000000000000000000000000000000
--- a/tests/nameservice/nameservice_test.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 2012 The Native Client Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <inttypes.h>
-#include <sys/fcntl.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "native_client/src/include/nacl_assert.h"
-#include "native_client/src/public/imc_syscalls.h"
-#include "native_client/src/public/name_service.h"
-#include "native_client/src/shared/srpc/nacl_srpc.h"
-
-int main(void) {
- int ns;
- NaClSrpcChannel channel;
- int connected_socket;
- int status;
- int rng;
-
- if (!NaClSrpcModuleInit()) {
- fprintf(stderr, "srpc module init failed\n");
- return 1;
- }
- printf("Hello world\n");
- ns = -1;
- nacl_nameservice(&ns);
- printf("ns = %d\n", ns);
- assert(-1 != ns);
-
- connected_socket = imc_connect(ns);
- assert(-1 != connected_socket);
- if (!NaClSrpcClientCtor(&channel, connected_socket)) {
- fprintf(stderr, "Srpc client channel ctor failed\n");
- return 1;
- }
- printf("NaClSrpcClientCtor succeeded\n");
- if (NACL_SRPC_RESULT_OK !=
- NaClSrpcInvokeBySignature(&channel, NACL_NAME_SERVICE_LOOKUP,
- "SecureRandom", O_RDONLY, &status, &rng)) {
- fprintf(stderr, "nameservice lookup failed, status %d\n", status);
- return 1;
- }
- printf("rpc status %d\n", status);
- /*
- * Now that the "SecureRandom" service has been removed, there is no
- * service that is registered with the name service by default that we
- * can test here. "ManifestNameService" only gets registered after the
- * "reverse service" is initialized, which doesn't normally happen in
- * standalone sel_ldr. So we just check that querying returns a sensible
- * error here.
- */
- ASSERT_EQ(NACL_NAME_SERVICE_NAME_NOT_FOUND, status);
-
- return 0;
-}
« no previous file with comments | « tests/nameservice/nacl.scons ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698