<commit_before>/* vi: set ts=4 expandtab shiftwidth=4: */
/**
 * @file
 *
 * Copyright 2019 Digital Aggregates Corporation, Colorado, USA<BR>
 * Licensed under the terms in LICENSE.txt<BR>
 * <NAME> (<EMAIL>)<BR>
 * https://github.com/coverclock/com-diag-hazer<BR>
 *
 * ABSTRACT
 *
 * EXAMPLES
 *
 */

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <locale.h>
#include <wchar.h>
#undef NDEBUG
#include <assert.h>
#include "com/diag/hazer/coordinates.h"

const char EXAMPLE_HPP_LATITUDE[] = "39.794234216";
const char EXAMPLE_HPP_LONGITUDE[] = "-105.153377669";

const char EXAMPLE_NGS_LATITUDE[] = "39 47 39.24317(N)";
const char EXAMPLE_NGS_LONGITUDE[] = "105 09 12.15960(W)";

const char EXAMPLE_POS_LATITUDE[] = "39°47'39.243\"N";
const char EXAMPLE_POS_LONGITUDE[] = "105°09'12.159\"W";

const char EXAMPLE_HPP_DATA[] = "39.794212196, -105.153349930";
const char EXAMPLE_NGS_DATA[] = "39 47 39.16390(N) 105 09 12.05974(W)";
const char EXAMPLE_POS_DATA[] = "39°47'39.163\"N, 105°09'12.060\"W";

const char EXAMPLE_HPP_LINE[] = "HPP   39.794217657, -105.153375607 ±     1.0647m                       GNSS";
const char EXAMPLE_NGS_LINE[] = "NGS  39 47 39.18356(N) 105 09 12.15218(W)                              GNSS";
const char EXAMPLE_POS_LINE[] = "POS 39°47'39.183\"N, 105°09'12.152\"W    39.7942176, -105.1533756        GNSS";

const char EXAMPLE_HPP[] = "39.794212196 -105.153349930";
const char EXAMPLE_POS[] = "39°47'39.163\"N 105°09'12.060\"W";

const char EXAMPLE_HPP_OTHER[] = "-39.794212196, 105.153349930";
const char EXAMPLE_NGS_OTHER[] = "39 47 39.16390(S) 105 09 12.05974(E)";

int main(int argc, char * argv[])
{
    if (argc > 1) { (void)coordinates_debug(!0); }

    {
        int latituderc = 0;
        int longituderc = 0;
        double latitude = 0.0;
        double longitude = 0.0;
        latituderc = sscanf(EXAMPLE_HPP_LATITUDE, COORDINATES_SCANF_HPP, &latitude);
        longituderc = sscanf(EXAMPLE_HPP_LONGITUDE, COORDINATES_SCANF_HPP, &longitude);
        fprintf(stderr, "HPP LATITUDE=\"%s\"[%d] latitude=%.9f LONGITUDE=\"%s\"[%d] longitude=%.9f\n", EXAMPLE_HPP_LATITUDE, latituderc, latitude, EXAMPLE_HPP_LONGITUDE, longituderc, longitude);
        assert(latituderc == 1);<commit_msg>[1] Minor expansion of coordinates unit test. PASSED<commit_after>/* vi: set ts=4 expandtab shiftwidth=4: */
/**
 * @file
 *
 * Copyright 2019 Digital Aggregates Corporation, Colorado, USA<BR>
 * Licensed under the terms in LICENSE.txt<BR>
 * <NAME> (<EMAIL>)<BR>
 * https://github.com/coverclock/com-diag-hazer<BR>
 *
 * ABSTRACT
 *
 * EXAMPLES
 *
 */

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <locale.h>
#include <wchar.h>
#undef NDEBUG
#include <assert.h>
#include "com/diag/hazer/coordinates.h"

const char EXAMPLE_HPP_LATITUDE[] = "39.794234216";
const char EXAMPLE_HPP_LONGITUDE[] = "-105.153377669";

const char EXAMPLE_NGS_LATITUDE[] = "39 47 39.24317(N)";
const char EXAMPLE_NGS_LONGITUDE[] = "105 09 12.15960(W)";

const char EXAMPLE_POS_LATITUDE[] = "39°47'39.243\"N";
const char EXAMPLE_POS_LONGITUDE[] = "105°09'12.159\"W";

const char EXAMPLE_HPP_DATA[] = "39.794212196, -105.153349930";
const char EXAMPLE_NGS_DATA[] = "39 47 39.16390(N) 105 09 12.05974(W)";
const char EXAMPLE_POS_DATA[] = "39°47'39.163\"N, 105°09'12.060\"W";

const char EXAMPLE_HPP_LINE[] = "HPP   39.794217657, -105.153375607 ±     1.0647m                       GNSS";
const char EXAMPLE_NGS_LINE[] = "NGS  39 47 39.18356(N) 105 09 12.15218(W)                              GNSS";
const char EXAMPLE_POS_LINE[] = "POS 39°47'39.183\"N, 105°09'12.152\"W    39.7942176, -105.1533756        GNSS";

const char EXAMPLE_HPP[] = "39.794212196 -105.153349930";
const char EXAMPLE_POS[] = "39°47'39.163\"N 105°09'12.060\"W";

const char EXAMPLE_HPP_OTHER[] = "-39.794212196, 105.153349930";
const char EXAMPLE_NGS_OTHER[] = "39 47 39.16390(S) 105 09 12.05974(E)";

int main(int argc, char * argv[])
{
    if (argc > 1) { (void)coordinates_debug(!0); }

    {
        fputs("COORDINATES_SCANF_HPP=\"" COORDINATES_SCANF_HPP "\"\n", stderr);
        fputs("COORDINATES_SCANF_NGS=\"" COORDINATES_SCANF_NGS "\"\n", stderr);
        fputs("COORDINATES_SCANF_POS=\"" COORDINATES_SCANF_POS "\"\n", stderr);
    }

    {
        fprintf(stderr, "COORDINATES_SCANF_HPP: " COORDINATES_SCANF_HPP "\n", 359.999999999 );
        fprintf(stderr, "COORDINATES_SCANF_NGS: " COORDINATES_SCANF_NGS "\n", 359, 59, 59.999999, 'W');
        fprintf(stderr, "COORDINATES_SCANF_POS: " COORDINATES_SCANF_POS "\n", 359, 59, 59.999999, 'W');
    }

    {
        int latituderc = 0;
        int longituderc = 0;
        double latitude = 0.0;
        double longitude = 0.0;
        latituderc = sscanf(EXAMPLE_HPP_LATITUDE, COORDINATES_SCANF_HPP, &latitude);
        longituderc = sscanf(EXAMPLE_HPP_LONGITUDE, COORDINATES_SCANF_HPP, &longitude);
        fprintf(stderr, "HPP LATITUDE=\"%s\"[%d] latitude=%.9f LONGITUDE=\"%s\"[%d] longitude=%.9f\n", EXAMPLE_HPP_LATITUDE, latituderc, latitude, EXAMPLE_HPP_LONGITUDE, longituderc, longitude);
        assert(latituderc == 1);
{'fraction_non_alphanumeric': 0.15842167255594816, 'fraction_numerical': 0.1348645465253239, 'mean_word_length': 3.829383886255924, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 29, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2953352', 'n_tokens_mistral': 2616, 'n_tokens_neox': 2064, 'n_words': 407}