b8a93c611b460bf586180786c18fb8fdc91e1ae0
[platform/framework/web/crosswalk.git] / src / native_client / src / trusted / service_runtime / format_string_test.c
1 /*
2  * Copyright 2008 The Native Client Authors. All rights reserved.
3  * Use of this source code is governed by a BSD-style license that can
4  * be found in the LICENSE file.
5  */
6
7 #include <stdio.h>
8 #include <string.h>
9
10 #include "native_client/src/include/portability.h"
11 #include "native_client/src/include/nacl_assert.h"
12
13
14 int main(void) {
15   char buf[100];
16
17   sprintf(buf, "%"NACL_PRIxS, (size_t) -1);
18   printf("got:%s\n", buf);
19   if (sizeof(size_t) == 4) {
20     ASSERT_EQ(strcmp(buf, "ffffffff"), 0);
21   } else if (sizeof(size_t) == 8) {
22     ASSERT_EQ(strcmp(buf, "ffffffffffffffff"), 0);
23   } else {
24     ASSERT_MSG(0, "Unknown size_t size");
25   }
26   return 0;
27 }