comparison tests/js-logger/main.cpp @ 111:1ed760f6e0c6

Irccd: new brace styles, #487
author David Demelier <markand@malikania.fr>
date Wed, 27 Apr 2016 21:37:09 +0200
parents 378fdc2c7b56
children 28080933bac6
comparison
equal deleted inserted replaced
110:5d71d270a2dd 111:1ed760f6e0c6
60 loadJsLogger(ctx); 60 loadJsLogger(ctx);
61 61
62 try { 62 try {
63 duk::putGlobal(ctx, "\xff""\xff""name", "test"); 63 duk::putGlobal(ctx, "\xff""\xff""name", "test");
64 64
65 if (duk::pevalString(ctx, "Irccd.Logger.info(\"hello!\");") != 0) 65 if (duk::pevalString(ctx, "Irccd.Logger.info(\"hello!\");") != 0) {
66 throw duk::error(ctx, -1); 66 throw duk::error(ctx, -1);
67 }
67 68
68 ASSERT_EQ("plugin test: hello!", lineInfo); 69 ASSERT_EQ("plugin test: hello!", lineInfo);
69 } catch (const std::exception &ex) { 70 } catch (const std::exception &ex) {
70 FAIL() << ex.what(); 71 FAIL() << ex.what();
71 } 72 }
79 loadJsLogger(ctx); 80 loadJsLogger(ctx);
80 81
81 try { 82 try {
82 duk::putGlobal(ctx, "\xff""\xff""name", "test"); 83 duk::putGlobal(ctx, "\xff""\xff""name", "test");
83 84
84 if (duk::pevalString(ctx, "Irccd.Logger.warning(\"FAIL!\");") != 0) 85 if (duk::pevalString(ctx, "Irccd.Logger.warning(\"FAIL!\");") != 0) {
85 throw duk::error(ctx, -1); 86 throw duk::error(ctx, -1);
87 }
86 88
87 ASSERT_EQ("plugin test: FAIL!", lineWarning); 89 ASSERT_EQ("plugin test: FAIL!", lineWarning);
88 } catch (const std::exception &ex) { 90 } catch (const std::exception &ex) {
89 FAIL() << ex.what(); 91 FAIL() << ex.what();
90 } 92 }
100 loadJsLogger(ctx); 102 loadJsLogger(ctx);
101 103
102 try { 104 try {
103 duk::putGlobal(ctx, "\xff""\xff""name", "test"); 105 duk::putGlobal(ctx, "\xff""\xff""name", "test");
104 106
105 if (duk::pevalString(ctx, "Irccd.Logger.debug(\"starting\");") != 0) 107 if (duk::pevalString(ctx, "Irccd.Logger.debug(\"starting\");") != 0) {
106 throw duk::error(ctx, -1); 108 throw duk::error(ctx, -1);
109 }
107 110
108 ASSERT_EQ("plugin test: starting", lineDebug); 111 ASSERT_EQ("plugin test: starting", lineDebug);
109 } catch (const std::exception &ex) { 112 } catch (const std::exception &ex) {
110 FAIL() << ex.what(); 113 FAIL() << ex.what();
111 } 114 }