testvsn.c 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /* Licensed to the Apache Software Foundation (ASF) under one or more
  2. * contributor license agreements. See the NOTICE file distributed with
  3. * this work for additional information regarding copyright ownership.
  4. * The ASF licenses this file to You under the Apache License, Version 2.0
  5. * (the "License"); you may not use this file except in compliance with
  6. * the License. You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  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.
  15. */
  16. #include <stdio.h>
  17. #include "testutil.h"
  18. #include "fspr_version.h"
  19. #include "fspr_general.h"
  20. static void test_strings(abts_case *tc, void *data)
  21. {
  22. ABTS_STR_EQUAL(tc, APR_VERSION_STRING, fspr_version_string());
  23. }
  24. #ifdef APR_IS_DEV_VERSION
  25. # define IS_DEV 1
  26. #else
  27. # define IS_DEV 0
  28. #endif
  29. static void test_ints(abts_case *tc, void *data)
  30. {
  31. fspr_version_t vsn;
  32. fspr_version(&vsn);
  33. ABTS_INT_EQUAL(tc, APR_MAJOR_VERSION, vsn.major);
  34. ABTS_INT_EQUAL(tc, APR_MINOR_VERSION, vsn.minor);
  35. ABTS_INT_EQUAL(tc, APR_PATCH_VERSION, vsn.patch);
  36. ABTS_INT_EQUAL(tc, IS_DEV, vsn.is_dev);
  37. }
  38. abts_suite *testvsn(abts_suite *suite)
  39. {
  40. suite = ADD_SUITE(suite)
  41. abts_run_test(suite, test_strings, NULL);
  42. abts_run_test(suite, test_ints, NULL);
  43. return suite;
  44. }