// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. /*============================================================================ ** ** Source: test1.c ** ** Purpose: Test #1 for the sprintf_s function. A single, basic, test ** case with no formatting. ** ** **==========================================================================*/ #include #include "../sprintf_s.h" /* * Depends on memcmp and strlen */ int __cdecl main(int argc, char *argv[]) { char checkstr[] = "hello world"; char buf[256]; if (PAL_Initialize(argc, argv) != 0) { return FAIL; } sprintf_s(buf, _countof(buf), "hello world"); if (memcmp(checkstr, buf, strlen(checkstr)+1) != 0) { Fail("ERROR: expected %s, got %s\n", checkstr, buf); } PAL_Terminate(); return PASS; }