2007-02-26 18:54:03 +00:00
|
|
|
#include <config.h>
|
|
|
|
|
2005-01-27 21:05:44 +00:00
|
|
|
#include "../lstrings.h"
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
2005-01-27 21:05:44 +00:00
|
|
|
using namespace lyx::support;
|
2007-02-26 18:54:03 +00:00
|
|
|
using namespace lyx;
|
2005-01-27 21:05:44 +00:00
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
void test_lowercase()
|
|
|
|
{
|
2007-02-26 18:54:03 +00:00
|
|
|
cout << to_ascii(docstring(1, lowercase(char_type('A')))) << endl;
|
|
|
|
cout << to_ascii(lowercase(from_ascii("AlLe"))) << endl;
|
2005-01-27 21:05:44 +00:00
|
|
|
cout << lowercase('A') << endl;
|
2007-02-26 18:54:03 +00:00
|
|
|
cout << ascii_lowercase("AlLe") << endl;
|
2005-01-27 21:05:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void test_uppercase()
|
|
|
|
{
|
2007-02-26 18:54:03 +00:00
|
|
|
cout << to_ascii(docstring(1, uppercase(char_type('a')))) << endl;
|
|
|
|
cout << to_ascii(uppercase(from_ascii("AlLe"))) << endl;
|
2005-01-27 21:05:44 +00:00
|
|
|
cout << uppercase('a') << endl;
|
|
|
|
}
|
|
|
|
|
2015-05-14 10:10:42 +00:00
|
|
|
void test_formatFPNumber()
|
|
|
|
{
|
|
|
|
cout << formatFPNumber(0) << endl;
|
|
|
|
cout << formatFPNumber(1) << endl;
|
|
|
|
cout << formatFPNumber(23.42) << endl;
|
|
|
|
cout << formatFPNumber(1.3754937356458394574047e-20) << endl;
|
|
|
|
cout << formatFPNumber(1.3754937356458394574047e-19) << endl;
|
|
|
|
cout << formatFPNumber(1.3754937356458394574047e-18) << endl;
|
|
|
|
cout << formatFPNumber(1.3754937356458394574047e-17) << endl;
|
|
|
|
cout << formatFPNumber(1.3754937356458394574047e-16) << endl;
|
|
|
|
cout << formatFPNumber(1.3754937356458394574047e-15) << endl;
|
|
|
|
cout << formatFPNumber(1.3754937356458394574047e-14) << endl;
|
|
|
|
cout << formatFPNumber(1.3754937356458394574047e-13) << endl;
|
|
|
|
cout << formatFPNumber(1.3754937356458394574047e-12) << endl;
|
|
|
|
cout << formatFPNumber(1.3754937356458394574047e-11) << endl;
|
|
|
|
cout << formatFPNumber(1.3754937356458394574047e-10) << endl;
|
|
|
|
cout << formatFPNumber(1.3754937356458394574047e-9) << endl;
|
|
|
|
cout << formatFPNumber(1.3754937356458394574047e-8) << endl;
|
|
|
|
cout << formatFPNumber(1.3754937356458394574047e-7) << endl;
|
|
|
|
cout << formatFPNumber(1.3754937356458394574047e-6) << endl;
|
|
|
|
cout << formatFPNumber(1.3754937356458394574047e-5) << endl;
|
|
|
|
cout << formatFPNumber(1.3754937356458394574047e-4) << endl;
|
|
|
|
cout << formatFPNumber(1.3754937356458394574047e-3) << endl;
|
|
|
|
cout << formatFPNumber(1.3754937356458394574047e-2) << endl;
|
|
|
|
cout << formatFPNumber(1.3754937356458394574047e-1) << endl;
|
|
|
|
cout << formatFPNumber(1.3754937356458394574047) << endl;
|
|
|
|
cout << formatFPNumber(1.3754937356458394574047e1) << endl;
|
|
|
|
cout << formatFPNumber(1.3754937356458394574047e2) << endl;
|
|
|
|
cout << formatFPNumber(1.3754937356458394574047e3) << endl;
|
|
|
|
cout << formatFPNumber(1.3754937356458394574047e4) << endl;
|
|
|
|
cout << formatFPNumber(1.3754937356458394574047e5) << endl;
|
|
|
|
cout << formatFPNumber(1.3754937356458394574047e6) << endl;
|
|
|
|
cout << formatFPNumber(1.3754937356458394574047e7) << endl;
|
|
|
|
cout << formatFPNumber(1.3754937356458394574047e8) << endl;
|
|
|
|
cout << formatFPNumber(1.3754937356458394574047e9) << endl;
|
|
|
|
cout << formatFPNumber(1.3754937356458394574047e10) << endl;
|
|
|
|
cout << formatFPNumber(1.3754937356458394574047e11) << endl;
|
|
|
|
cout << formatFPNumber(1.3754937356458394574047e12) << endl;
|
|
|
|
cout << formatFPNumber(1.3754937356458394574047e13) << endl;
|
|
|
|
cout << formatFPNumber(1.3754937356458394574047e14) << endl;
|
|
|
|
cout << formatFPNumber(1.3754937356458394574047e15) << endl;
|
|
|
|
cout << formatFPNumber(1.3754937356458394574047e16) << endl;
|
|
|
|
cout << formatFPNumber(1.3754937356458394574047e17) << endl;
|
|
|
|
cout << formatFPNumber(1.3754937356458394574047e18) << endl;
|
|
|
|
cout << formatFPNumber(1.3754937356458394574047e19) << endl;
|
|
|
|
cout << formatFPNumber(1.3754937356458394574047e20) << endl;
|
|
|
|
cout << formatFPNumber(1e-42) << endl;
|
|
|
|
cout << formatFPNumber(1e42) << endl;
|
|
|
|
}
|
|
|
|
|
2005-04-26 11:12:20 +00:00
|
|
|
int main()
|
2005-01-27 21:05:44 +00:00
|
|
|
{
|
|
|
|
test_lowercase();
|
|
|
|
test_uppercase();
|
2015-05-14 10:10:42 +00:00
|
|
|
test_formatFPNumber();
|
2005-01-27 21:05:44 +00:00
|
|
|
}
|