Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / native_client / tests / environment_variables / env_var_test.c
1 /*
2  * Copyright 2010 The Native Client Authors. All rights reserved.
3  * Use of this source code is governed by a BSD-style license that can be
4  * found in the LICENSE file.
5  */
6
7 #include <assert.h>
8 #include <stdio.h>
9 #include <stdlib.h>
10 #include <string.h>
11 #include <unistd.h>
12
13
14 int main(int argc, char **argv, char **env) {
15   int count = 0;
16   char **ptr;
17
18   for (ptr = environ; *ptr != NULL; ptr++) {
19     count++;
20   }
21   printf("%i environment variables\n", count);
22   for (ptr = environ; *ptr != NULL; ptr++) {
23     printf("%s\n", *ptr);
24   }
25
26   assert(env == environ);
27
28   return 0;
29 }