File tree 3 files changed +20
-7
lines changed
3 files changed +20
-7
lines changed Original file line number Diff line number Diff line change 2
2
3
3
using namespace php ;
4
4
5
- TEST (variant, toCString) {
6
- std::string s1 (" hello world" );
7
- Variant s2 (" hello world" );
8
- ASSERT_STREQ (s1.c_str (), s2.toCString ());
5
+ TEST (exec, func) {
6
+ auto retval = exec (" is_dir" , " /tmp" );
7
+ ASSERT_TRUE (retval.toBool ());
9
8
}
Original file line number Diff line number Diff line change
1
+ #include " phpx_test.h"
2
+
3
+ using namespace php ;
4
+
5
+ TEST (hash, md5) {
6
+ constexpr int l = 1024 ;
7
+ auto rdata = exec (" random_byets" , l);
8
+ ASSERT_EQ (rdata.length (), l);
9
+ String str (rdata);
10
+ String hash1 = md5 (str);
11
+ auto hash2 = exec (" md5" , rdata);
12
+ ASSERT_STREQ (hash1.c_str (), hash2.toCString ());
13
+ }
Original file line number Diff line number Diff line change 2
2
3
3
using namespace php ;
4
4
5
- TEST (exec, func) {
6
- auto retval = exec (" is_dir" , " /tmp" );
7
- ASSERT_TRUE (retval.toBool ());
5
+ TEST (variant, toCString) {
6
+ std::string s1 (" hello world" );
7
+ Variant s2 (" hello world" );
8
+ ASSERT_STREQ (s1.c_str (), s2.toCString ());
8
9
}
You can’t perform that action at this time.
0 commit comments