Remove test code
This commit is contained in:
parent
538807da1b
commit
b136e35b31
26
main.cpp
26
main.cpp
|
@ -23,8 +23,6 @@ static void testGet() {
|
||||||
aug = aug_init(root, loadpath, AUG_NO_STDINC | AUG_NO_LOAD);
|
aug = aug_init(root, loadpath, AUG_NO_STDINC | AUG_NO_LOAD);
|
||||||
|
|
||||||
r = aug_load_file(aug, "/etc/hosts");
|
r = aug_load_file(aug, "/etc/hosts");
|
||||||
|
|
||||||
|
|
||||||
r = aug_source(aug, "/files/etc/hosts/1", &s);
|
r = aug_source(aug, "/files/etc/hosts/1", &s);
|
||||||
|
|
||||||
std::cout << "The value read from node: " << s << std::endl;
|
std::cout << "The value read from node: " << s << std::endl;
|
||||||
|
@ -32,7 +30,7 @@ static void testGet() {
|
||||||
aug_close(aug);
|
aug_close(aug);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void testAugPreview() {
|
static void readHostsFile() {
|
||||||
struct augeas *aug;
|
struct augeas *aug;
|
||||||
int r;
|
int r;
|
||||||
char *s;
|
char *s;
|
||||||
|
@ -67,11 +65,31 @@ static void testAugPreview() {
|
||||||
aug_close(aug);
|
aug_close(aug);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void readHostsTree() {
|
||||||
|
struct augeas *aug;
|
||||||
|
int r;
|
||||||
|
char *s;
|
||||||
|
char *etc_hosts_fn = NULL;
|
||||||
|
FILE *hosts_fp = NULL;
|
||||||
|
char *hosts_txt = NULL;
|
||||||
|
int readsz = 0;
|
||||||
|
|
||||||
|
aug = aug_init(root, loadpath, AUG_NO_STDINC | AUG_NO_LOAD);
|
||||||
|
|
||||||
|
r = aug_load_file(aug, "/etc/hosts");
|
||||||
|
r = aug_preview(aug, "/files/etc/hosts/1", &s);
|
||||||
|
|
||||||
|
std::cout << s << std::endl;
|
||||||
|
|
||||||
|
free(hosts_txt);
|
||||||
|
free(s);
|
||||||
|
aug_close(aug);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
|
|
||||||
testGet();
|
testGet();
|
||||||
testAugPreview();
|
readHostsFile();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
Loading…
Reference in New Issue