2 * Copyright (C) 2011 The Android Open Source Project
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 // Minimal test program for strptime
24 int main(int argc, char **argv)
29 // For now, only test a couple of formats that use recursion
31 memset(&tm, 0, sizeof(tm));
32 strptime("11:14", "%R", &tm);
33 strftime(buf, sizeof(buf), "%H:%M", &tm);
35 puts(!strcmp(buf, "11:14") ? "OK" : "FAILED");
37 memset(&tm, 0, sizeof(tm));
38 strptime("09:41:53", "%T", &tm);
39 strftime(buf, sizeof(buf), "%H:%M:%S", &tm);
41 puts(!strcmp(buf, "09:41:53") ? "OK" : "FAILED");