aboutsummaryrefslogtreecommitdiffstats
path: root/src/test.cc
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-09-03 05:29:46 +0200
committerMattias Andrée <maandree@operamail.com>2014-09-03 05:29:46 +0200
commite11c1974c97a0e783f4bea4c619ae3250383ed45 (patch)
treebde9b1a139ba3e7adde8719133972398e3c34ff9 /src/test.cc
parentstates and crtc info (diff)
downloadlibgammamm-e11c1974c97a0e783f4bea4c619ae3250383ed45.tar.gz
libgammamm-e11c1974c97a0e783f4bea4c619ae3250383ed45.tar.bz2
libgammamm-e11c1974c97a0e783f4bea4c619ae3250383ed45.tar.xz
functions from libgamma-facade that will not be moved into classes
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/test.cc')
-rw-r--r--src/test.cc47
1 files changed, 46 insertions, 1 deletions
diff --git a/src/test.cc b/src/test.cc
index 5118e8e..0c63f88 100644
--- a/src/test.cc
+++ b/src/test.cc
@@ -27,9 +27,11 @@ int main(void)
libgamma::Partition* partition;
libgamma::CRTC* crtc;
libgamma::CRTCInformation info;
+ int method;
std::string* str;
char* cstr;
+ unsigned char* edid;
libgamma::perror("test", 0);
libgamma::perror("test", 2);
@@ -46,7 +48,50 @@ int main(void)
delete str;
std::cout << std::endl;
- site = new libgamma::Site(LIBGAMMA_METHOD_X_RANDR, new std::string(":0"));
+ for (int m : libgamma::list_methods(0))
+ std::cout << m << " ";
+ std::cout << std::endl;
+ for (int m : libgamma::list_methods(1))
+ std::cout << m << " ";
+ std::cout << std::endl;
+ for (int m : libgamma::list_methods(2))
+ std::cout << m << " ";
+ std::cout << std::endl;
+ for (int m : libgamma::list_methods(3))
+ std::cout << m << " ";
+ std::cout << std::endl;
+ for (int m : libgamma::list_methods(4))
+ std::cout << m << " ";
+ std::cout << std::endl;
+ std::cout << std::endl;
+ method = libgamma::list_methods(0)[0];
+
+ std::cout << libgamma::is_method_available(LIBGAMMA_METHOD_X_RANDR) << std::endl;
+ str = libgamma::method_default_site(LIBGAMMA_METHOD_X_RANDR);
+ if (str == nullptr)
+ std::cout << "(nullptr)" << std::endl;
+ else
+ std::cout << *str << std::endl;
+ delete str;
+ str = libgamma::method_default_site_variable(LIBGAMMA_METHOD_X_RANDR);
+ if (str == nullptr)
+ std::cout << "(nullptr)" << std::endl;
+ else
+ std::cout << *str << std::endl;
+ delete str;
+ std::cout << std::endl;
+
+ edid = libgamma::unhex_edid("0123456789abcdef");
+ cstr = libgamma_behex_edid(edid, 8);
+ std::cout << cstr << std::endl;
+ free(cstr);
+ std::cout << libgamma::behex_edid(edid, 8) << std::endl;
+ std::cout << libgamma::behex_edid_lowercase(edid, 8) << std::endl;
+ std::cout << libgamma::behex_edid_uppercase(edid, 8) << std::endl;
+ free(edid);
+ std::cout << std::endl;
+
+ site = new libgamma::Site(method, new std::string(":0"));
std::cout << site->partitions_available << std::endl;
partition = new libgamma::Partition(site, 0);
std::cout << partition->crtcs_available << std::endl;